> For the complete documentation index, see [llms.txt](https://fehdead.gitbook.io/npc-kit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/sin.md).

# npc.sin

```lua
npc.sin(radians)
```

|                         |                                                                      |
| ----------------------- | -------------------------------------------------------------------- |
| id                      | `0x0009`                                                             |
| arguments               | 1: Float                                                             |
| result                  | Float: goes to the very next call, or to `npc.lua(npc.sin(...), fn)` |
| in NPC Kit              | yes                                                                  |
| measured from a kit NPC | returns                                                              |
| vanilla scripts         | 1315 calls in 198 of 1114 scripts                                    |

## What it does

Gives the sine of an angle in radians. A result.

## Arguments

### `radians` (Float)

The angle.

## Result

The sine, a float.

## Timing

Returns at once.

## In NPC Kit

Use Lua's `math.sin` when `npc.add` runs instead: the VM's result can only feed the next call, so it can't take part in arithmetic. Vanilla uses it to compute points around an actor.

## Used with

* [cos](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/cos.md).

## Example

A point 1.5 in front of the NPC, as vanilla computes it with `sin` / `cos` of the heading, but in Lua:

```lua
local home, h = { 29.36, -9.0, 68.65 }, 1.676      -- where init places it, and its dir
local x = home[1] + math.sin(h) * 1.5
local z = home[3] + math.cos(h) * 1.5

stepForward = function()
    npc.rmove(x, home[2], z);
    npc.movesync();
end,
```
