Kiwi.Geom.Ray Class
Represents a halfline. The ray starts at the first point and extends infinitely in the direction of the second.
Constructor
Kiwi.Geom.Ray
-
[x1=0]
-
[y1=0]
-
[x2=0]
-
[y2=0]
Parameters:
-
[x1=0]
Number optionalStarting location of the ray on the x-axis.
-
[y1=0]
Number optionalStarting location of the ray on the y-axis.
-
[x2=0]
Number optionalEnd location of the ray on the x-axis. Used to calculate direction so it isn't really the 'end' location.
-
[y2=0]
Number optionalEnd location of the ray on the y-axis. Used to calculate direction so it isn't really the 'end' location.
Returns:
This Object
Item Index
Methods
clone
-
[output]
Makes a copy of this Ray either as a new Ray object or, makes a passed Ray a copy of this one.
Parameters:
-
[output]
Kiwi.Geom.Ray optional
Returns:
copyFrom
-
source
Makes this Ray the same as a passed Ray.
Parameters:
-
source
Kiwi.Geom.Ray
Returns:
copyTo
-
target
Makes a passed Ray the same as this Ray object.
Parameters:
-
target
Kiwi.Geom.Ray
Returns:
isPointOnRay
-
x
-
y
Check if the Ray passes through a point.
Parameters:
-
x
Number -
y
Number
Returns:
objType
()
String
public
The type of this object.
Returns:
"Ray"
setTo
-
[x1=0]
-
[y1=0]
-
[x2=0]
-
[y2=0]
Sets the origin and the direction of this Ray.
Parameters:
-
[x1=0]
Number optional -
[y1=0]
Number optional -
[x2=0]
Number optional -
[y2=0]
Number optional
Returns:
toString
()
String
public
Get a string representation of the ray.
Returns:
Properties
angle
Number
public
Get the angle of the ray.
slope
Number
public
Get the slope of the ray.
x1
Number
public
The x component of the initial point of the ray
Default: 0
x2
Number
public
The x component of the direction point of the ray
Default: 0
y1
Number
public
The y component of the initial point of the ray
Default: 0
y2
Number
public
The y component of the direction point of the ray
Default: 0