Class: Vector3

Raphael3d. Vector3

representrs Euclidean vector

new Vector3(x, y, z)

Vector3 implementation
This:
Parameters:
Name Type Argument Description
x number <optional>
x coordinate
y number <optional>
y coordinate
z number <optional>
z coordinate
Properties:
Name Type Description
x number x coordinate
y number y coordinate
z number z coordinate
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 474

Methods

add(v) → {Raphael3d.Vector3}

Returns sum of receiver and another Vector3
Parameters:
Name Type Description
v Raphael3d.Vector3 | Raphael3d.Vertex
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 494
Returns:
sum of receiver and v
Type
Raphael3d.Vector3

beCopyOf(v) → {Raphael3d.Vector3}

Copy another Vector3 to receiver. Changes receiver
Parameters:
Name Type Description
v Raphael3d.Vector3 | Raphael3d.Vertex
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 546
Returns:
changed receiver (now equal to v)
Type
Raphael3d.Vector3

copy() → {Raphael3d.Vector3}

Copy receiver
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 556
Returns:
copied receiver
Type
Raphael3d.Vector3

cross(v) → {Raphael3d.Vector3}

Returns cross product of receiver and another vector
Parameters:
Name Type Description
v Raphael3d.Vector3 | Raphael3d.Vertex
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 525
Returns:
cross product of receiver and v
Type
Raphael3d.Vector3

dot(v) → {number}

Returns dot product of receiver and another vector
Parameters:
Name Type Description
v Raphael3d.Vector3 | Raphael3d.Vertex
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 510
Returns:
dot product of receiver and v
Type
number

isEqualTo(v) → {boolean}

Checks equality of receiver with another Vector3
Parameters:
Name Type Description
v Raphael3d.Vector3 | Raphael3d.Vertex
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 571
Returns:
true if receiver and v equals, false otherwise
Type
boolean

norm() → {number}

Returns (Euclidean) norm of receiver
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 517
Returns:
norm of receiver
Type
number

normalize()

Normalize receiver
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 535

setCoordinates(x, y, z) → {Raphael3d.Vector3}

Sets coordinates to receiver and returns it
Parameters:
Name Type Description
x number new x coordinate
y number new y coordinate
z number new z coordinate
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 581
Returns:
changed receiver
Type
Raphael3d.Vector3

sub(v) → {Raphael3d.Vector3}

Returns difference of receiver and another Vector3
Parameters:
Name Type Description
v Raphael3d.Vector3 | Raphael3d.Vertex
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 502
Returns:
difference of receiver and v
Type
Raphael3d.Vector3

toString() → {string}

Returns string representation of receiver
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 563
Returns:
copied receiver
Type
string

<static> create(x, y, z) → {Raphael3d.Vector3}

Creates new Vector3 instance
Parameters:
Name Type Argument Description
x number <optional>
x coordinate
y number <optional>
y coordinate
z number <optional>
z coordinate
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 486
Returns:
Type
Raphael3d.Vector3

<static> UnitX() → {Raphael3d.Vector3}

Returns unit Vector3 in x direction
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 592
Returns:
x unit vector
Type
Raphael3d.Vector3

<static> UnitY() → {Raphael3d.Vector3}

Returns unit Vector3 in y direction
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 599
Returns:
y unit vector
Type
Raphael3d.Vector3

<static> UnitZ() → {Raphael3d.Vector3}

Returns unit Vector3 in z direction
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 606
Returns:
z unit vector
Type
Raphael3d.Vector3