(
from: MotionPoint,
to: MotionPoint,
control: MotionPoint,
t: number,
)
| 192 | |
| 193 | /** Ein Punkt der Bahn, bei `t` zwischen 0 und 1. Quadratische Bezierkurve. */ |
| 194 | export function transitionPointAt( |
| 195 | from: MotionPoint, |
| 196 | to: MotionPoint, |
| 197 | control: MotionPoint, |
| 198 | t: number, |
| 199 | ): MotionPoint { |
| 200 | const e = t <= 0 ? 0 : t >= 1 ? 1 : t; |
| 201 | const inv = 1 - e; |
| 202 | const a = inv * inv; |
| 203 | const b = 2 * inv * e; |
| 204 | const c = e * e; |
| 205 | return { |
| 206 | x: a * from.x + b * control.x + c * to.x, |
| 207 | y: a * from.y + b * control.y + c * to.y, |
| 208 | z: a * from.z + b * control.z + c * to.z, |
| 209 | }; |
| 210 | } |
| 211 | |
| 212 | /** |
| 213 | * Der Abstand eines Punktes von der Geraden durch zwei andere, in der |
no outgoing calls
no test coverage detected