Geom.vector3()¶
Description¶
Creates a 3D vector, setting its direction and length.
Syntax¶
JS
Geom.vector3(x: Number, y: Number, z: Number) -> Vector3
Geom.vector3(p: Point3) -> Vector3
Geom.vector3(p1: Point3, p2: Point3) -> Vector3
Parameters¶
Parameter | Type | Default Value | Mandatory | Description |
---|---|---|---|---|
x |
Number |
— | x-coordinate of the point | |
y |
Number |
— | y-coordinate of the point | |
z |
Number |
— | z-coordinate of the point | |
p |
Point3 |
— | Point that defines the vector's origin | |
p1 |
Point3 |
— | Starting point of the vector | |
p2 |
Point3 |
— | Ending point of the vector |
See Also
The vector can be created either from coordinates [x, y, z]
, or from one point p
, or from two points p1
and p2
.
Return value¶
Type | Description |
---|---|
Vector3 |
Object of type Vector3 , a three-dimensional vector. |
Example¶
JS | |
---|---|