| Package | flash.geom |
| Class | public class Line |
| Implements | IParametric |
start and end
and realized to support internal method lineTo().t points on line Pt equally bearing
distance from point Pt at start point S
with distace from end point E at start point S.
Pt = (E-S)*t (1)See also
| Property | Defined by | ||
|---|---|---|---|
| angle : Number
Angle of incline line at radian.
| Line | ||
| bounds : Rectangle [read-only]
Return overall rectangle of object.
| Line | ||
| end : Point
Final bearing(anchor) point of piece of line.
| Line | ||
| isSegment : Boolean
Defined, is line infinite in both side
or limited in borders of interators 0-1.
Current variable isSegment influense at results of methods: intersectionBezier intersectionLine getClosest Bezier.intersectionLine | Line | ||
| length : Number [read-only]
Calculate and return length of piece of line
start-end. | Line | ||
| start : Point
First anchor point of piece of line.
| Line | ||
| Property | Defined by | ||
|---|---|---|---|
| __end : Point | Line | ||
| __isSegment : Boolean | Line | ||
| __start : Point | Line | ||
| Method | Defined by | ||
|---|---|---|---|
|
Line(start:Point, end:Point, isSegment:Boolean = true)
| Line | ||
|
angleOffset(rad:Number, fulcrum:Point = null):void
Rotate line respection at point
fulcrum at current angle. | Line | ||
|
| Line | ||
|
getClosest(fromPoint:Point):Number
Calculate and return point on line, the nearest at given.
| Line | ||
|
getPoint(time:Number, point:Point = null):Point
Calculate and return point on line, given by time-iterator.
| Line | ||
|
getSegment(fromTime:Number = 0, toTime:Number = 1):Line
Return piece of line - segment of line, given by beginning and ending interators.
| Line | ||
|
getSegmentLength(time:Number):Number
Return length of segment of line from point
start
at point on line, given by time-iterator. | Line | ||
|
getTimeByDistance(distance:Number):Number
Calculate and return time-iterator of point that can be found at given distance on line from point start.
| Line | ||
|
getTimesSequence(step:Number, startShift:Number = 0):Array
Calculate and return array of points on line than can be found at distance
given be parameter
step.First point of array will be moved from start point at distance, given be parameter startShift. | Line | ||
|
Calculate and return crossing with Bezier;
| Line | ||
|
Calculate and return crossing of two lines.
| Line | ||
|
offset(dX:Number = 0, dY:Number = 0):void
Move line at given distance at axes X and Y.
| Line | ||
|
setPoint(time:Number, x:Number, y:Number):void
Change position of point
end,
that point Ptime take coordinates,
given by parameters x and y. | Line | ||
|
toString():String
| Line | ||
| Method | Defined by | ||
|---|---|---|---|
|
initInstance(start:Point, end:Point, isSegment:Boolean = true):void
| Line | ||
| Constant | Defined by | ||
|---|---|---|---|
| PRECISION : Number = 1e-10 | Line | ||
| angle | property |
angle:Number [read-write]
Angle of incline line at radian.
Rotate realize respecting at point start.
The return value is between positive PI and negative PI.
public function get angle():Number
public function set angle(value:Number):void
| bounds | property |
bounds:Rectangle [read-only]Return overall rectangle of object.
Implementation public function get bounds():Rectangle
| __end | property |
protected var __end:Point
| end | property |
end:Point [read-write]
Final bearing(anchor) point of piece of line. Interator time equally 1.
public function get end():Point
public function set end(value:Point):void
| __isSegment | property |
protected var __isSegment:Boolean
| isSegment | property |
isSegment:Boolean [read-write]
Defined, is line infinite in both side
or limited in borders of interators 0-1.
Current variable isSegment influense at results of methods:
intersectionBezier
intersectionLine
getClosest
Bezier.intersectionLine
The default value is true.
public function get isSegment():Boolean
public function set isSegment(value:Boolean):void
See also
| length | property |
length:Number [read-only]
Calculate and return length of piece of line start-end.
Return number only positively;
public function get length():Number
| __start | property |
protected var __start:Point
| start | property |
start:Point [read-write]
First anchor point of piece of line. Interator time equally 0.
public function get start():Point
public function set start(value:Point):void
| Line | () | constructor |
public function Line(start:Point, end:Point, isSegment:Boolean = true)Parameters
start:Point |
|
end:Point |
|
isSegment:Boolean (default = true) |
| angleOffset | () | method |
public function angleOffset(rad:Number, fulcrum:Point = null):void
Rotate line respection at point fulcrum at current angle.
If point fulcrum undefined, then automatically use (0,0);
rad:Number — angle(radian)
|
|
fulcrum:Point (default = null) — center of rotation.
If variable undefined, center of rotation is point start
|
| clone | () | method |
| getClosest | () | method |
public function getClosest(fromPoint:Point):NumberCalculate and return point on line, the nearest at given.
ParametersfromPoint:Point — - free point.
|
Number — Number - time-interator of point on line.
|
See also
| getPoint | () | method |
public function getPoint(time:Number, point:Point = null):PointCalculate and return point on line, given by time-iterator.
Parameterstime:Number — time-итератор
|
|
point:Point (default = null) |
Point — Point point on line
|
| getSegment | () | method |
public function getSegment(fromTime:Number = 0, toTime:Number = 1):LineReturn piece of line - segment of line, given by beginning and ending interators.
ParametersfromTime:Number (default = 0) — time-iterator first point of segment
|
|
toTime:Number (default = 1) — time-iterator end point of segment of curve
|
Line —
Line
|
| getSegmentLength | () | method |
public function getSegmentLength(time:Number):Number
Return length of segment of line from point start
at point on line, given by time-iterator.
time:Number — - iterator of point.
|
Number — Number
|
| getTimeByDistance | () | method |
public function getTimeByDistance(distance:Number):NumberCalculate and return time-iterator of point that can be found at given distance on line from point start.
Parametersdistance:Number |
Number — Number
|
| getTimesSequence | () | method |
public function getTimesSequence(step:Number, startShift:Number = 0):Array
Calculate and return array of points on line than can be found at distance
given be parameter step.
First point of array will be moved from start point at distance,
given be parameter startShift.
If variable startShift bigger then
step, will be used remainder from segmentation on step.
Use this method it - calculating consecution of points
for drawing dotted lines.
step:Number |
|
startShift:Number (default = 0) |
Array |
| initInstance | () | method |
protected function initInstance(start:Point, end:Point, isSegment:Boolean = true):voidParameters
start:Point |
|
end:Point |
|
isSegment:Boolean (default = true) |
| intersectionBezier | () | method |
public function intersectionBezier(target:Bezier):IntersectionCalculate and return crossing with Bezier;
Parameterstarget:Bezier |
Intersection |
| intersectionLine | () | method |
public function intersectionLine(targetLine:Line):IntersectionCalculate and return crossing of two lines.
ParameterstargetLine:Line |
Intersection —
Intersection;
|
See also
| offset | () | method |
public function offset(dX:Number = 0, dY:Number = 0):voidMove line at given distance at axes X and Y.
ParametersdX:Number (default = 0) — variable of moving at axe X
|
|
dY:Number (default = 0) — variable of moving at axe Y
|
| setPoint | () | method |
public function setPoint(time:Number, x:Number, y:Number):void
Change position of point end,
that point Ptime take coordinates,
given by parameters x and y.
If parameter x or y undefined,
correspond variable Ptime
don't change.
time:Number |
|
x:Number |
|
y:Number |
| toString | () | method |
public function toString():StringReturns
String |
| PRECISION | constant |
protected const PRECISION:Number = 1e-10