Kiwi.Geom.Line Class
A Kiwi Line object has two meanings depending on the situation you need. Either an infinte line through space (this is the usual meaning of a Line) OR it can be a Line Segment which just exists between the TWO points you specify.
Constructor
Kiwi.Geom.Line
-
[x1
-
[y1
-
[x2
-
[y2
Parameters:
-
[x1
Number= 0] x1 x component of first point.
-
[y1
Number= 0] y1 y component of first point.
-
[x2
Number= 0] x2 x component of second point.
-
[y2
Number= 0] y2 y component of second point.
Returns:
This Object
Item Index
Methods
Methods
clone
-
[output
Makes a clone of this Line. The clone will either be a new Line Object, Otherwise you can pass a existing Line Object that you want to be a clone of this one.
Parameters:
-
[output
Kiwi.Geom.Line= Line]
Returns:
copyFrom
-
source
Make this Line a copy of another passed Line.
Parameters:
-
source
Kiwi.Geom.Linesource
Returns:
copyTo
-
target
Make another passed Line a copy of this one.
Parameters:
-
target
Kiwi.Geom.Linetarget
Returns:
getY
-
x
Get the y of a point on the line for a given x.
Parameters:
-
x
Number
Returns:
intersectLineLine
-
line
Check to see if this Line object intersects at any point with a passed Line. Note: Both are treated as extending infinately through space.
Parameters:
-
line
Kiwi.Geom.LineThe line you want to check for a Intersection with.
Returns:
The Intersect Result containing the collision information.
isPointOnLine
-
x
-
y
Check if a point is on the line.
Parameters:
-
x
Number -
y
Number
Returns:
isPointOnLineSegment
-
x
-
y
Check if the point is both on the line and within the line segment.
Parameters:
-
x
Number -
y
Number
Returns:
objType
()
String
public
Returns the type of this object
Returns:
The type of this object
perp
-
x
-
y
-
[output
Get a line perpendicular to the line passing through a given point.
Parameters:
-
x
Number -
y
Number -
[output
Kiwi.Geom.Line= Line]
Returns:
setTo
-
[x1
-
[y1
-
[x2
-
[y2
Used to set all components on the line.
Parameters:
-
[x1
Number= 0] X component of first point.
-
[y1
Number= 0] Y component of first point.
-
[x2
Number= 0] X component of second point.
-
[y2
Number= 0] Y component of second point.
Returns:
toString
()
String
public
Get a string representation of the line.
Returns:
Properties
angle
Unknown
Get the angle of the line.
length
Number
public
Get the length of the Line as a Line Segment.
perpSlope
Unknown
public
Get the perpendicular slope of the line (x/y).
slope
Unknown
public
Get the slope of the line (y/x).
x1
Number
public
X position of first point in your line.
x2
Number
public
X position of second point.
y1
Number
public
Y position of first point in your line.
y2
Number
public
X position of second point.
Get the y intercept for the line.