Version: v0.0.0-...-b13d3a1 Latest Latest Go to latest
Published: Nov 26, 2018 License: Zlib

## Documentation ¶

### Overview ¶

Package math provides structures and functions to handle mathematical functions. Example of use: cartesian functions with different types, round numbers, conversion of number types.

### Constants ¶

This section is empty.

### Variables ¶

This section is empty.

### Functions ¶

#### func MulPointWithInt ¶

`func MulPointWithInt(a *sdl.Point, b int32) *sdl.Point`

MulPointWithInt multiply a point with an int

#### func Round ¶

`func Round(num float32) int32`

Round rounds the float point to int

#### func Round64 ¶

`func Round64(num float64) int64`

Round64 rounds the float point to int

#### func SumPoint ¶

`func SumPoint(a *sdl.Point, b *sdl.Point) *sdl.Point`

SumPoint sums two Points

#### func SumPointWithFPoint ¶

`func SumPointWithFPoint(a *sdl.Point, b *FPoint) *sdl.Point`

SumPointWithFPoint sums a Point to a FPoint. It loses precision. The result is rounded.

### Types ¶

#### type FPoint ¶

```type FPoint struct {
X float32
Y float32
}```

FPoint is the float point

#### func ConvertPointToFPoint ¶

`func ConvertPointToFPoint(a *sdl.Point) *FPoint`

ConvertPointToFPoint converts a Point to a FPoint

#### func MulFPointWithFloat ¶

`func MulFPointWithFloat(a *FPoint, b float32) *FPoint`

MulFPointWithFloat multiply a FPoint with a float

#### func SumFPoint ¶

`func SumFPoint(a *FPoint, b *FPoint) *FPoint`

SumFPoint sums two FPoints