Sp3dV3D class Null safety

(en) This is a class for handling 3D vectors.

(ja) 3次元ベクトルを扱うためのクラスです。

Author Masahide Mori

First edition creation date 2021-05-23 18:38:57

Constructors

Sp3dV3D(double x, double y, double z)
Constructor [...]

Properties

class_name String
final
hashCode int
The hash code for this object. [...]
read-only, override
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
version String
final
x double
read / write
y double
read / write
z double
read / write

Methods

add(Sp3dV3D v) Sp3dV3D
(en)Adds other vector to this vector and returns this vector. [...]
deep_copy() Sp3dV3D
Deep copy the object.
div(num scalar) Sp3dV3D
(en)Divide this vector by the scalar value and return this vector. [...]
equals(Sp3dV3D other, double e_range) bool
(en)Compare while considering the error. Returns true if x, y, z are all within the e_range. [...]
is_zero() bool
(en)Return true if parameter is all zero, otherwise false. [...]
len() double
(en)Return vector length. [...]
mul(num scalar) Sp3dV3D
(en)Multiplies this vector by a scalar value and returns this vector. [...]
nor() Sp3dV3D
(en)Return Normalized Vector. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
ortho() Sp3dV3D
(en)Return random orthogonal vector. [...]
rotate(Sp3dV3D nor_axis, double radian) Sp3dV3D
(en)Return rotated this vector. [...]
rotated(Sp3dV3D nor_axis, double radian) Sp3dV3D
(en)Return rotated new vector. [...]
set(Sp3dV3D v) Sp3dV3D
(en)Overwrites the contents of this vector with the contents of the other vector and returns this vector. [...]
sub(Sp3dV3D v) Sp3dV3D
(en)Subtracts other vector from this vector and returns this vector. [...]
to_dict() Map<String, dynamic>
Convert the object to a dictionary.
toString() String
A string representation of this object. [...]
override

Operators

operator *(num scalar) Sp3dV3D
operator +(Sp3dV3D v) Sp3dV3D
operator -(Sp3dV3D v) Sp3dV3D
operator /(num scalar) Sp3dV3D
operator ==(Object v) bool
The equality operator. [...]
override

Static Methods

angle(Sp3dV3D a, Sp3dV3D b) double
(en)Return the radian between vector A and vector B. When converting to degrees, degrees = radian*180/pi. [...]
ave(List<Sp3dV3D> v) Sp3dV3D
(en)Return the averaged vector. [...]
cross(Sp3dV3D a, Sp3dV3D b) Sp3dV3D
(en)Return cross product. [...]
dist(Sp3dV3D a, Sp3dV3D b) double
(en)Return euclidean distance. [...]
dot(Sp3dV3D a, Sp3dV3D b) double
(en)Return dot product. [...]
from_dict(Map<String, dynamic> src) Sp3dV3D
Restore this object from the dictionary. [...]
proj(Sp3dV3D v, Sp3dV3D nor_v) Sp3dV3D
(en)Return projection vector. [...]
surface_normal(List<Sp3dV3D> face) Sp3dV3D
(en)Calculates and returns the surface normal. The order of the vertices must be counterclockwise. Note that this cannot be used for degenerate polygons. [...]