PP.ellipseTranslate

Syntax

ellipseTranslate(point: PP.Point, radiusX: Number, radiusY: Number, angle: Number);

Parameters

point. Ellipsis center.

radiusX. X axis radius.

radiusY. Y axis radius.

angle. Rotation angle in radians.

Description

The ellipseTranslate method calculates coordinates of a point on ellipsis.

Comments

This method returns an object of the PP.Point type.

Example

To execute the example, the HTML page must contain links to the PP.js and PP.GraphicsBase.js scenario files. Determine coordinates of a point in the ellipsis with the radii 5 and 8 pixels and the center in the (10, 10) point:

// Create a point with the coordinates (10, 10)
var point = new PP.Point(10, 10)
// Determine rotation angle in degrees
var angle = 45;
// Determine coordinates of the point on the ellipse with radii 5 and 8 pixels and with center in the point (10, 10)
var result = PP.ellipseTranslate(point, 5, 8, PP.g2r(angle));
console.log("Point coordinates: (" + result.getX() + ", " + result.getY() + ")");

After executing the example the browser console displays coordinates of a point in the ellipsis with the radii 5 and 8 pixels and the center in the (10, 10) point:

Point coordinates: (13.535533905932738, 15.65685424949238)

See also:

PP