kcl-std → functions → ellipticPoint

ellipticPointFunction in std::sketch

Calculate the point (x, y) on an ellipse given x or y and the center and major/minor radii of the ellipse.

ellipticPoint(
  majorRadius: number,
  minorRadius: number,
  x?: number(Length),
  y?: number(Length),
): Point2d

Arguments

NameTypeDescriptionRequired
majorRadiusnumberThe major radius, a, of the elliptic equation x^2 / a ^ 2 + y^2 / b^2 = 1.Yes
minorRadiusnumberThe minor radius, b, of the hyperbolic equation x^2 / a ^ 2 + y^2 / b^2 = 1.Yes
xnumber(Length)The x value. Calculates y and returns (x, y). Incompatible with y.No
ynumber(Length)The y value. Calculates x and returns (x, y). Incompatible with x.No

Returns

Point2d - A point in two dimensional space.

Examples

point001 = ellipticPoint(x = 2, majorRadius = 2, minorRadius = 1)
point002 = ellipticPoint(y = 0, majorRadius = 2, minorRadius = 1)
assert(point001[0], isEqualTo = point002[0])
assert(point001[1], isEqualTo = point002[1])

Rendered example of ellipticPoint 0

Found a typo?