# Matematik (Math)

## Math.Abs()

Returnerar det absoluta värdet hos ett tal som anges som parameter.

```csharp
float y = Math.Abs(-0.45f); // y får värdet 0.45
```

## Math.Sin(), Math.Cos(), Math.Tan()

Returnerar sinus, cosinus eller tangens av vinkeln som anges som parameter. Vinkeln behöver anges i radianer.

```csharp
float s = Math.Sin(3.4f);
```

De inverterade trigonomiska funktionerna finns också - de heter Math.Asin, Math.Acos och Math.Atan.

## Math.Max()

Returnerar det största av två värden som anges som parametrar

```csharp
int i = Math.Max(4, 12); // i blir 12.
```

## Math.Min()

Returnerar det minsta av två värden som anges som parametrar

```csharp
int i = Math.Min(4, 12); // i blir 4.
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://csharp.progdocs.se/grundlaggande/matematik-math.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
