Flash 8 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > Point (flash.geom.Point) > interpolate (Point.interpolate method) | |||
public static interpolate(pt1:Point, pt2:Point, f:Number) : Point
Determines a point between two specified points. The parameter f determines where the new interpolated point is located relative to the two end points specified by parameters pt1 and pt2. The closer parameter f is to 1.0, the closer the interpolated point will be to the first point (parameter pt1). The closer parameter f is to 0, the closer the interpolated point will be to the second point (parameter pt2).
Availability: ActionScript 1.0; Flash Player 8
pt1:flash.geom.Point - The first point.
pt2:flash.geom.Point - The second point.
f:Number - The level of interpolation between the two points. Indicates where the new point will be, along the line between pt1 and pt2. If f=1, pt1 is returned; if f=0, pt2 is returned.
flash.geom.Point - The new, interpolated point.
The following example locates the interpolated point (interpolatedPoint) half way (50%) between point_1 and point_2.
import flash.geom.Point; var point_1:Point = new Point(-100, -100); var point_2:Point = new Point(50, 50); var interpolatedPoint:Point = Point.interpolate(point_1, point_2, .5); trace(interpolatedPoint.toString()); // (x=-25, y=-25)
Version 8
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/8/main/00002598.html
Comments
No screen name said on Aug 5, 2006 at 10:08 AM : Craig Grummitt said on Oct 9, 2006 at 5:15 PM :