vec

package
v0.0.0-...-99d09c7 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2015 License: BSD-3-Clause Imports: 2 Imported by: 4

Documentation

Overview

Package vec contains vector related functionality

Copyright 2015 Markus Dittrich Licensed under BSD license, see LICENSE file for details

Index

Constants

This section is empty.

Variables

View Source
var NullVec3 = Vec3{0.0, 0.0, 0.0}

NullVec3 is a convenience definition for the null vector

Functions

This section is empty.

Types

type Vec3

type Vec3 struct {
	X, Y, Z float64
}

Vec3 is a 3D vector

func (Vec3) Add

func (v Vec3) Add(w Vec3) Vec3

Add adds Vec3 v and Vec3 w

func (Vec3) Cross

func (v Vec3) Cross(w Vec3) Vec3

Cross computes the cross product of Vec3 v with Vec3 w

func (Vec3) Dot

func (v Vec3) Dot(w Vec3) float64

Dot computes the dot product of Vec3 v with Vec3 w

func (Vec3) Equal

func (v Vec3) Equal(w Vec3) bool

Equal determines if Vec3 v and w are identical. Identity is determined via component-wise identity

func (Vec3) Norm

func (v Vec3) Norm() float64

Norm is a method for Vec3 computing its L2 norm

func (Vec3) Norm2

func (v Vec3) Norm2() float64

Norm2 is a method for Vec3 computing its squared L2 norm

func (Vec3) Scalar

func (v Vec3) Scalar(a float64) Vec3

Scalar computes the scalar multiplication of scalar a with Vec3 v

func (Vec3) Sub

func (v Vec3) Sub(w Vec3) Vec3

Sub subtracts Vec3 v and Vec3 w

Jump to

Keyboard shortcuts

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