r3

package
v0.0.0-...-d7e5178 Latest Latest
Warning

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

Go to latest
Published: May 31, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package r3 implements types and functions for working with geometry in ℝ³.

See ../s2 for a more detailed overview.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Vector

type Vector struct {
	X, Y, Z float64
}

Vector represents a point in ℝ³.

func (Vector) Abs

func (v Vector) Abs() Vector

Abs returns the vector with nonnegative components.

func (Vector) Add

func (v Vector) Add(ov Vector) Vector

Add returns the standard vector sum of v and ov.

func (Vector) Angle

func (v Vector) Angle(ov Vector) s1.Angle

Angle returns the angle between v and ov.

func (Vector) ApproxEqual

func (v Vector) ApproxEqual(ov Vector) bool

ApproxEqual reports whether v and ov are equal within a small epsilon.

func (Vector) Cross

func (v Vector) Cross(ov Vector) Vector

Cross returns the standard cross product of v and ov.

func (Vector) Distance

func (v Vector) Distance(ov Vector) float64

Distance returns the Euclidean distance between v and ov.

func (Vector) Dot

func (v Vector) Dot(ov Vector) float64

Dot returns the standard dot product of v and ov.

func (Vector) IsUnit

func (v Vector) IsUnit() bool

IsUnit returns whether this vector is of approximately unit length.

func (Vector) Mul

func (v Vector) Mul(m float64) Vector

Mul returns the standard scalar product of v and m.

func (Vector) Norm

func (v Vector) Norm() float64

Norm returns the vector's norm.

func (Vector) Norm2

func (v Vector) Norm2() float64

Norm2 returns the square of the norm.

func (Vector) Normalize

func (v Vector) Normalize() Vector

Normalize returns a unit vector in the same direction as v.

func (Vector) Ortho

func (v Vector) Ortho() Vector

Ortho returns a unit vector that is orthogonal to v. Ortho(-v) = -Ortho(v) for all v.

func (Vector) String

func (v Vector) String() string

func (Vector) Sub

func (v Vector) Sub(ov Vector) Vector

Sub returns the standard vector difference of v and ov.

Jump to

Keyboard shortcuts

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