* Calculates the angle a 2D vector makes with the positive x-axis. * * By convention, the positive x-axis has an angle of 0. Angles increase in * the clockwise direction. * * If the vector was created with * createVector() , `heading()` returns angles
()
| 1930 | * } |
| 1931 | */ |
| 1932 | heading() { |
| 1933 | const h = Math.atan2(this.y, this.x); |
| 1934 | if (this.isPInst) return this._fromRadians(h); |
| 1935 | return h; |
| 1936 | } |
| 1937 | |
| 1938 | /** |
| 1939 | * Rotates a 2D vector to a specific angle without changing its magnitude. |
no outgoing calls
no test coverage detected