optimizeAngle

fun optimizeAngle(desiredAngle: Double, currentAngle: Double): Double

A function that calculates the which way a wheel should be facing for the least rotation.

Return

The optimized angle.

Parameters

desiredAngle

The angle you want to face towards.

currentAngle

The angle you are currently at.