3d direction vector
More...
#include <angelcad.h>
3d direction vector
vec3d is a 3-dimensional vector offering useful operations such as dot and cross products.
◆ vec3d() [1/3]
Construct direction vector as direction from p1 to p2.
- Parameters
-
◆ vec3d() [2/3]
vec3d::vec3d |
( |
const vec3d@ |
other | ) |
|
Construct direction vector from other vector.
- Parameters
-
◆ vec3d() [3/3]
vec3d::vec3d |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
z |
|
) |
| |
Create direction vector from x,y and z components.
- Parameters
-
x | double, vector x component
|
y | double, vector y component
|
z | double, vector z component |
◆ angle()
double vec3d::angle |
( |
const vec3d@ |
other | ) |
const |
angle between: double rad = v.angle(other);
- Parameters
-
other | vec3d@, vector to compute angle relative to this
|
- Returns
- double, angle value in radians
◆ cross()
cross product: double cp = v.cross(other);
- Parameters
-
other | vec3d@, vector to multiply with
|
- Returns
- vec3d@, cross product value
◆ dot()
double vec3d::dot |
( |
const vec3d@ |
other | ) |
const |
dot product: double cp = v.dot(other);
- Parameters
-
other | vec3d@, vector to multiply with
|
- Returns
- double, dot product value
◆ length()
double vec3d::length |
( |
| ) |
const |
length of vector
- Returns
- double, length of vector
◆ normalise()
void vec3d::normalise |
( |
| ) |
|
◆ opAdd()
Add vector to vector, return new vector: vec3d@ v = v0 + v1.
- Parameters
-
- Returns
- vec3d@
◆ opMul()
vec3d@ vec3d::opMul |
( |
double |
f1 | ) |
|
Multiply vector with factor, return new vector: vec3d@ v = v0 * f1.
- Parameters
-
- Returns
- vec3d@
◆ opMul_r()
vec3d@ vec3d::opMul_r |
( |
double |
f1 | ) |
|
Multiply vector with factor, return new vector: vec3d@ v = f1 * v0.
- Parameters
-
- Returns
- vec3d@
◆ opSub()
Subtract vector from vector, return new vector: vec3d@ v = v0 - v1.
- Parameters
-
- Returns
- vec3d@
◆ x()
double vec3d::x |
( |
| ) |
const |
vector x component
- Returns
- double, vector x component
◆ y()
double vec3d::y |
( |
| ) |
const |
vector y component
- Returns
- double, vector y component
◆ z()
double vec3d::z |
( |
| ) |
const |
vector z component
- Returns
- double, vector z component
The documentation for this class was generated from the following file: