Vector

A vector composed of components (X, Y, Z) with floating point precision.

Tip

This structure is Open Sourced at https://github.com/nanos-world/nanos-world-lua-lib. Feel free to push merge requests and suggest changes!

Tip

This structure supports +, -, *, /, ^, ==, and tostring operations.

Usage

local NewVector = Vector(1452.5, 512, 943.1)

Properties

Type

Name

Description

number

X

X Coordinate

number

Y

Y Coordinate

number

Z

Z Coordinate

Functions

Returns

Name

Description

boolean

Equals(Vector Other, number Tolerance)

number

SizeSquared()

number

Size()

boolean

IsNearlyZero(number Tolerance)

boolean

IsZero()

number

DistanceSquared(Vector Other)

number

Distance(Vector Other)