* project this vector on to another vector. * @param v - The vector to project onto. * @returns Reference to this object for method chaining
(v: Vector2d | Vector3d)
| 459 | * @returns Reference to this object for method chaining |
| 460 | */ |
| 461 | project(v: Vector2d | Vector3d) { |
| 462 | const ratio = this.dot(v) / v.length2(); |
| 463 | return this.scale(ratio, ratio, ratio); |
| 464 | } |
| 465 | |
| 466 | /** |
| 467 | * Project this vector onto a vector of unit length.<br> |
no test coverage detected