---
title: "atan2 | open.mp"
description: "Arc‑tangens met y,x (in graden) teruggeven."
canonical: https://omp.itsneufox.com/nl/docs/scripting/functions/atan2
language: nl
---

# atan2

waarschuwing

De y‑waarde is de eerste parameter en x de tweede (y/x‑notatie).

## Beschrijving

Geef de arc‑tangens in graden, rekening houdend met het teken van beide argumenten om de kwadrant te bepalen.

| Naam | Beschrijving |
| --- | --- |
| Float:y | aandeel van de y‑coördinaat |
| Float:x | aandeel van de x‑coördinaat |

## Retourneert

De hoek in graden, in het interval \[-180.0, +180.0\].

## Voorbeeld

```c
//De arc‑tangens voor (x=-10.000000, y=10.000000) is 135.000000 graden.
public OnGameModeInit()
{
    new Float:x, Float:y, Float:result;
    x = -10.0;
    y = 10.0;
    result = atan2(y, x);
    printf("The arc tangent for (x=%f, y=%f) is %f degrees.", x, y, result);
    return 1;
}
```

## Gerelateerd

-   [floatsin](https://omp.itsneufox.com/nl/docs/scripting/functions/floatsin)
-   [floatcos](https://omp.itsneufox.com/nl/docs/scripting/functions/floatcos)
-   [floattan](https://omp.itsneufox.com/nl/docs/scripting/functions/floattan)
-   [asin](https://omp.itsneufox.com/nl/docs/scripting/functions/asin)
-   [acos](https://omp.itsneufox.com/nl/docs/scripting/functions/acos)
-   [atan](https://omp.itsneufox.com/nl/docs/scripting/functions/atan)
