MCPcopy Create free account
hub / github.com/botbotrobotics/BotBrain / normalizeAngle

Function normalizeAngle

frontend/src/utils/waypointProjection.ts:30–34  ·  view source on GitHub ↗
(angle: number)

Source from the content-addressed store, hash-verified

28 * Normalize angle to [-PI, PI] range
29 */
30export function normalizeAngle(angle: number): number {
31 while (angle > Math.PI) angle -= 2 * Math.PI;
32 while (angle < -Math.PI) angle += 2 * Math.PI;
33 return angle;
34}
35
36/**
37 * Calculate shortest angular difference between two angles

Callers 4

useSmoothedPoseFunction · 0.90
angleDifferenceFunction · 0.70
projectWaypointFunction · 0.70
projectPathPointFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected