### 3 releases

✓ Uses Rust 2018 edition

new 0.1.2 | Jul 2, 2020 |
---|---|

0.1.1 | Jun 29, 2020 |

0.1.0 | Jun 28, 2020 |

#**135** in Math

**MIT/Apache**

87KB

2K SLoC

# fpn

Fixed Point Number with Vector2/Vector3 for graphic algebra

## Documentation

Details please check crate documentation:

### `lib.rs`

:

Fixed Point Numbers

Fixed point number is designed to provide a memory presentation for real numbers. Currently implemented only for a few cases for purpose of real usages, but will make it flexible enough later.

FPN is the struct which contains a primitive for memory presentation with a specified length of bits for fractions. Normal

(`F64`

) and `FPN <i64, U12>`

`F32`

(`FPN``<``i32`, U8`>`

) should be fine for usages. But be careful about the range overflow which doing `Add`

, `Mul`

and `Div`

FPN also provides trigonometric functions including

, `sin`

and `cos`

.`tan`

and `Vector2`

provides the graphic computation containers for 2D and 3D, while `Vector3`

(`F64Vector2`

), `Vector2 <F64>`

`F64Vector3`

, `F32Vector2`

and `F32Vector3`

for fixed numbers.

trait and `Dot`

provides the dot product and cross product, while `Cross`

trait provides the function convert a Cartesian Coordinate to a Polar/Spherical Coordinates.`Polar`

trait and `Rotate2`

trait provides the function to rotate `Rotate3`

around the origin point and rotate `Vector2`

around the axises.`Vector3`

#### Dependencies

~155KB