point

package
v0.0.0-...-1b60a0e Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package point represents a point in a left-handed 3D coordinate system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Subtract

func Subtract(pt1 Point, pt2 Point) *vector.Vector

Subtract returns a new Vector with components equal to the difference of the corresponding components in the passed Points.

Types

type Point

type Point struct {
	// X, Y, and Z represent components in a left-handed 3D coordinate system
	X, Y, Z float64
}

Point represents a point in a left-handed 3D coordinate system

func Add

func Add(pt *Point, vec *vector.Vector) *Point

Add returns a new Point with components equal to the sum of the corresponding components in the passed Point and Vector.

func NewPoint

func NewPoint(x, y, z float64) *Point

NewPoint returns a new Point that has the passed X, Y, and Z values.

func (*Point) Add

func (pt *Point) Add(vec *vector.Vector) *Point

Add modifies each component of this Point by setting each of them to the sum of the components in this Point and the passed Vector.

func (*Point) Equals

func (pt *Point) Equals(ptQ *Point) bool

Equals returns true if the passed Point is equal to this Point. Two Points are equal if their X, Y, Z components are equal.

func (*Point) Negate

func (pt *Point) Negate() *Point

Negate multiplies each of this Point's components by -1.

func (*Point) Scale

func (pt *Point) Scale(scalar float64) *Point

Scale multiplies each of this Point's components by the passed scalar value.

func (*Point) Subtract

func (pt *Point) Subtract(vec *vector.Vector) *Point

Subtract modifies each component of this Point by setting each of them to the difference of the components in this Point and the passed Vector.

Jump to

Keyboard shortcuts

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