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
Name | Type | Description | Required |
---|---|---|---|
coefficients | [number; 3] | The coefficients [a, b, c] of the parabolic equation y = ax^2 + bx + c. | Yes |
x | number(Length) | The x value. Calculates y and returns (x, y). Incompatible with y . | No |
y | number(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])