quaternion

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Quaternion

type Quaternion struct {
	X float64
	Y float64
	Z float64
	W float64
}

A unit quaternion used for representing 3D rotations.

func Between

func Between(p_v0, p_v1 vector3.Vector3) Quaternion

Constructs a quaternion representing the shortest arc between two points on the surface of a sphere with a radius of 1.0.

func From

func From(quaternion *Quaternion) Quaternion

Constructs a Quaternion as a copy of the given Quaternion.

func IDENTITY

func IDENTITY() Quaternion

The identity quaternion, representing no rotation. Equivalent to an identity Basis matrix. If a vector is transformed by an identity quaternion, it will not change.

func New

func New(p_x, p_y, p_z, p_w float64) Quaternion

Constructs a quaternion defined by the given values.

func Rotated

func Rotated(axisNormal vector3.Vector3, angle float64) Quaternion

Constructs a quaternion that will rotate around the given axis by the specified angle. The axis must be a normalized vector.

func ZERO

func ZERO() Quaternion

Constructs a default-initialized quaternion with all components set to 0.

Jump to

Keyboard shortcuts

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