gogm

package module
v0.0.0-...-e1be1b9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2022 License: MIT Imports: 1 Imported by: 2

README

gogm

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func V2CopyV2

func V2CopyV2[T1, T2 number](dst *Vec2[T1], src *Vec2[T2])

V2CopyV2 copies the content of src to dst.

func V2CopyV3

func V2CopyV3[T1, T2 number](dst *Vec2[T1], src *Vec3[T2])

V2CopyV3 copies the content of src to dst.

func V2CrossV2

func V2CrossV2[T number](v1 *Vec2[T], v2 *Vec2[T]) T

V2CrossV2 takes the cross product of v1 and v2, and returns the result.

func V2DotV2

func V2DotV2[T number](v1 *Vec2[T], v2 *Vec2[T]) T

V2DotV2 takes the dot product of v1 and v2, and returns the result.

func V3CopyV2

func V3CopyV2[T1, T2 number](dst *Vec3[T1], src *Vec2[T2])

V3CopyV2 copies the content of src to dst.

func V3CopyV3

func V3CopyV3[T1, T2 number](dst *Vec3[T1], src *Vec3[T2])

V3CopyV3 copies the content of src to dst.

func V3DotV3

func V3DotV3[T number](v1 *Vec3[T], v2 *Vec3[T]) T

V3DotV3 takes the dot product of v1 and v2, and returns the result.

Types

type Vec2

type Vec2[T number] [2]T

Vec2 is a vector with 2 components, of type T.

func (*Vec2[T]) Inverse

func (v1 *Vec2[T]) Inverse(v2 *Vec2[T])

Invert sets v1 to the inverse of v2. v1 = -v2

func (*Vec2[T]) V2AddS

func (v1 *Vec2[T]) V2AddS(v2 *Vec2[T], s T)

V2AddS adds each component of v2 with s, and stores the result in v1. v1 = v2 + s

func (*Vec2[T]) V2AddV2

func (v1 *Vec2[T]) V2AddV2(v2 *Vec2[T], v3 *Vec2[T])

V2AddV2 adds v2 with v3 component-wise, and stores the result in v1. v1 = v2 + v3

func (*Vec2[T]) V2DivS

func (v1 *Vec2[T]) V2DivS(v2 *Vec2[T], s T)

V2DivS adds each component of v2 with s, and stores the result in v1. v1 = v2 / s

func (*Vec2[T]) V2DivV2

func (v1 *Vec2[T]) V2DivV2(v2 *Vec2[T], v3 *Vec2[T])

V2DivV2 divides v2 by v3 component-wise, and stores the result in v1. v1 = v2 / v3

func (*Vec2[T]) V2MulS

func (v1 *Vec2[T]) V2MulS(v2 *Vec2[T], s T)

V2MulS multiplies each component of v2 with s, and stores the result in v1. v1 = v2 * s

func (*Vec2[T]) V2MulV2

func (v1 *Vec2[T]) V2MulV2(v2 *Vec2[T], v3 *Vec2[T])

V2MulV2 multiplies v2 with v3 component-wise, and stores the result in v1. v1 = v2 * v3

func (*Vec2[T]) V2SubS

func (v1 *Vec2[T]) V2SubS(v2 *Vec2[T], s T)

V2SubS subtracts each component of v2 by s, and stores the result in v1. v1 = v2 - s

func (*Vec2[T]) V2SubV2

func (v1 *Vec2[T]) V2SubV2(v2 *Vec2[T], v3 *Vec2[T])

V2SubV2 subtracts v2 from v3 component-wise, and stores the result in v1. v1 = v2 - v3

type Vec3

type Vec3[T number] [3]T

Vec3 is a vector with 3 components, of type T.

func (*Vec3[T]) Inverse

func (v1 *Vec3[T]) Inverse(v2 *Vec3[T])

Invert sets v1 to the inverse of v2. v1 = -v2

func (*Vec3[T]) V3AddS

func (v1 *Vec3[T]) V3AddS(v2 *Vec3[T], s T)

V3AddS adds each component of v2 with s, and stores the result in v1. v1 = v2 + s

func (*Vec3[T]) V3AddV3

func (v1 *Vec3[T]) V3AddV3(v2 *Vec3[T], v3 *Vec3[T])

V3AddV3 adds v2 with v3 component-wise, and stores the result in v1. v1 = v2 + v3

func (*Vec3[T]) V3CrossV3

func (v1 *Vec3[T]) V3CrossV3(v2 *Vec3[T], v3 *Vec3[T])

V3CrossV3 takes the cross product of v1 and v2, and stores the result in v1. v1 = v2 x v3

func (*Vec3[T]) V3CrossV3Fast

func (v1 *Vec3[T]) V3CrossV3Fast(v2 *Vec3[T], v3 *Vec3[T])

V3CrossV3Fast takes the cross product of v1 and v2, and stores the result in v1. v1 = v2 x v3

func (*Vec3[T]) V3DivS

func (v1 *Vec3[T]) V3DivS(v2 *Vec3[T], s T)

V3DivS divides each component of v2 by s, and stores the result in v1. v1 = v2 / s

func (*Vec3[T]) V3DivV3

func (v1 *Vec3[T]) V3DivV3(v2 *Vec3[T], v3 *Vec3[T])

V3DivV3 divides v2 by v3 component-wise, and stores the result in v1. v1 = v2 / v3

func (*Vec3[T]) V3MulS

func (v1 *Vec3[T]) V3MulS(v2 *Vec3[T], s T)

V3MulS multiplies each component of v2 with s, and stores the result in v1. v1 = v2 * s

func (*Vec3[T]) V3MulV3

func (v1 *Vec3[T]) V3MulV3(v2 *Vec3[T], v3 *Vec3[T])

V3MulV3 multiplies v2 with v3 component-wise, and stores the result in v1. v1 = v2 * v3

func (*Vec3[T]) V3SubS

func (v1 *Vec3[T]) V3SubS(v2 *Vec3[T], s T)

V3SubS subtracts each component of v2 by s, and stores the result in v1. v1 = v2 - s

func (*Vec3[T]) V3SubV3

func (v1 *Vec3[T]) V3SubV3(v2 *Vec3[T], v3 *Vec3[T])

V3SubV3 subtracts v2 from v3 component-wise, and stores the result in v1. v1 = v2 - v3

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL