kcl-std → functions → parabolicPoint

parabolicPointFunction in std::sketch

Calculate the point (x, y) on a parabola given x or y and the coefficients [a, b, c] of the parabola.

parabolicPoint(
  coefficients: [number; 3],
  x?: number(Length),
  y?: number(Length),
): Point2d

Arguments

NameTypeDescriptionRequired
coefficients[number; 3]The coefficients [a, b, c] of the parabolic equation y = ax^2 + bx + c.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 = parabolicPoint(x = 5, coefficients = [0.1, 0, 0])
point002 = parabolicPoint(y = 2.5, coefficients = [0.1, 0, 0])
assert(point001[0], isEqualTo = point002[0])
assert(point001[1], isEqualTo = point002[1])

Rendered example of parabolicPoint 0

Found a typo?