---
url: /docs/api/core/functions/computeMacroTargets.md
---
[**@kaiord/core**](../README.md)

***

[@kaiord/core](../README.md) / computeMacroTargets

# Function: computeMacroTargets()

> **computeMacroTargets**(`input`): `object`

Defined in: [packages/core/src/application/energy/macro-targets.ts:56](https://github.com/pablo-albaladejo/kaiord/blob/3eacbe62ef72342d970523967cc5155b5935bb85/packages/core/src/application/energy/macro-targets.ts#L56)

Derive protein/carb/fat gram targets from a calorie target and bodyweight.

## Parameters

### input

[`ComputeMacroTargetsInput`](../type-aliases/ComputeMacroTargetsInput.md)

## Returns

`object`

### carb_g

> **carb\_g**: `number`

### fat_g

> **fat\_g**: `number`

### kcal

> **kcal**: `number`

### protein_g

> **protein\_g**: `number`

## Throws

RangeError when `targetKcal` or `weightKg` is not positive and finite.
