enum Chem::Spatial::Direction
Overview
An enum that represents directions along the axes in 3D space.
Defined in:
chem/spatial/direction.crEnum Members
-
X =
0
-
Direction along the X axis
-
Y =
1
-
Direction along the Y axis
-
Z =
2
-
Direction along the Z axis
-
XY =
3
-
Direction along the X and Y axes
-
XZ =
4
-
Direction along the X and Z axes
-
YZ =
5
-
Direction along the Y and Z axes
-
XYZ =
6
-
Direction along the X, Y, and Z axes
Instance Method Summary
-
#includes?(axis : self) : Bool
Returns
true
if the direction includes the component axis, elsefalse
. -
#to_vector : Vec3
Returns the unit vector pointing towards this direction.
- #x?
- #xy?
- #xyz?
- #xz?
- #y?
- #yz?
- #z?
Instance Method Detail
def includes?(axis : self) : Bool
#
Returns true
if the direction includes the component axis, else
false
.
Direction::X.includes?(:x) # => true
Direction::Y.includes?(:x) # => false
Direction::XY.includes?(:x) # => true
Direction::YZ.includes?(:x) # => false
Direction::XYZ.includes?(:x) # => true
Direction::XY.includes?(:xy) # => true
Direction::X.includes?(:xy) # => false
Direction::XY.includes?(:xy) # => true
Direction::XZ.includes?(:xy) # => false
Direction::XYZ.includes?(:xy) # => true
Returns the unit vector pointing towards this direction.
Direction::X.to_vector # => Vec3[ 1 0 0 ]
Direction::Y.to_vector # => Vec3[ 0 1 0 ]
Direction::XY.to_vector # => Vec3[ 0.7071068 0.7071068 0 ]