stdspansion/mathextras/vector3d

Implements vector3ds, both floats and integers. Due to the way math works a lot of the time you will wind up with a float vector instead of an int vector. Converters are provided to help alleviate issues.

Types

FloatVector3D = object
  x*, y*, z*: float
IntVector3D = object
  x*, y*: int

Funcs

func initFloatVector3d(x, y, z: SomeNumber): FloatVector3D {...}{.inline.}
func initIntVector3d(x, y, z: SomeNumber): IntVector3D {...}{.inline.}
func add[T: SomeVector3D](a, b, z: T): T {...}{.inline.}
func sub[T: SomeVector3D](a, b, z: T): T {...}{.inline.}
func `div`[T: SomeVector3D](a, b, z: T): FloatVector3D {...}{.inline.}
func mul[T: SomeVector3D](a, b, z: T): T {...}{.inline.}
func `==`[T: SomeVector3D](a, b: T): bool {...}{.inline.}