Vector3 class

A 3D vector class for representing and manipulating vectors in three-dimensional space.

Implementers
Annotations

Constructors

Vector3(double x, double y, double z)
Constructs a Vector3 with the given x, y, and z components.
Vector3.zero()
Constructs a Vector3 initialized to zero (0, 0, 0).

Properties

hashCode int
The hash code for this object.
no setteroverride
length double
The length (magnitude) of this vector.
no setter
length2 double
The squared length of this vector.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
x double
The x component of the vector.
no setter
y double
The y component of the vector.
no setter
z double
The z component of the vector.
no setter

Methods

apply(double f(double)) Vector3
Applies a function f to each component of this vector and returns a new Vector3.
cross(Vector3 o) Vector3
Computes the cross product of this vector with another Vector3.
dot(Vector3 o) double
Computes the dot product of this vector with another Vector3.
normalize() Vector3
Normalizes this vector.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator *(double s) Vector3
Multiplies this vector by a scalar.
operator +(Vector3 o) Vector3
Adds this vector with another Vector3.
operator -(Vector3 o) Vector3
Subtracts another Vector3 from this vector.
operator /(double s) Vector3
Divides this vector by a scalar.
operator ==(Object other) bool
Determines whether this vector is equal to another object. Returns true if the other object is an Vector3 with the same components.
override
operator unary-() Vector3
Negates this vector.