point3ΒΆ

class point3

A 3 dimension point class

Members

Constructors:

point3 result create ( float x , float y , float z ) Builds a point3 (x, y, z)
point3 result create ( float x ) Builds a point3 (x, x, x)
point3 result create ( table p ) Builds a point3 (p[1], p[2], p[3])

Methods:

point3 result * ( point3/float other ) Returns self*other
point3 result + ( point3/float other ) Returns self+other
point3 result - ( ) Returns the opposite of self
point3 result - ( point3/float other ) Returns self-other
point3 result / ( point3/float other ) Returns self/other
point3 result ^ ( point3 other ) Returns the cross product between self and other
float result distance ( point3 other ) Returns the distance between self and other
float result dotproduct ( point3 other ) Returns the dot product between self and other
float result getlength ( ) Returns the magnitude of the vector
point3 result getmax ( point3/float other ) Returns the max of each components
point3 result getmin ( point3/float other ) Returns the min of each components
point3 result getnormalized ( ) Returns the normalized vector
float result getsqlength ( ) Returns the squar magnitude of the vector
bool result isreal ( ) Returns true if the point is a correct number, false if NAN or INF

Documentation

point3 result * ( point3/float other )

Returns self*other

Arguments:

  • other

Return:

  • result


point3 result + ( point3/float other )

Returns self+other

Arguments:

  • other

Return:

  • result


point3 result - ( )

Returns the opposite of self

Return:

  • result


point3 result - ( point3/float other )

Returns self-other

Arguments:

  • other

Return:

  • result


point3 result / ( point3/float other )

Returns self/other

Arguments:

  • other

Return:

  • result


point3 result ^ ( point3 other )

Returns the cross product between self and other

Arguments:

  • other

Return:

  • result


float result distance ( point3 other )

Returns the distance between self and other

Arguments:

  • other

Return:

  • result


float result dotproduct ( point3 other )

Returns the dot product between self and other

Arguments:

  • other

Return:

  • result


float result getlength ( )

Returns the magnitude of the vector

Return:

  • result


point3 result getmax ( point3/float other )

Returns the max of each components

Arguments:

  • other

Return:

  • result (max (self.X, other.X), max (self.Y, other.Y), max (self.Z, other.Z))


point3 result getmin ( point3/float other )

Returns the min of each components

Arguments:

  • other

Return:

  • result (min (self.X, other.X), min (self.Y, other.Y), min (self.Z, other.Z))


point3 result getnormalized ( )

Returns the normalized vector

Return:

  • result


float result getsqlength ( )

Returns the squar magnitude of the vector

Return:

  • result


bool result isreal ( )

Returns true if the point is a correct number, false if NAN or INF

Return:

  • result