Zeppelin icon indicating copy to clipboard operation
Zeppelin copied to clipboard

A question on function

Open ghost opened this issue 1 year ago • 4 comments

func DegreesToAngle(degrees float32) byte {
	return byte(math.Round(float64(degrees) * (256.0 / 360.0)))
}

func AngleToDegrees(angle byte) float32 {
	return float32(angle) * (360.0 / 256.0)
}

I think it should be degrees to radians and radians to degrees. I mean the ratio will work itself out to the same value, but what's the point of that thing. Shouldn't it be pi/180 and 180/pi?

ghost avatar Oct 21 '24 15:10 ghost

Sometimes rotations are in angle and sometimes in degrees (in the protocol)

oq-x avatar Oct 21 '24 15:10 oq-x

Angle has units of either radians or degrees.

ghost avatar Oct 22 '24 02:10 ghost

Yea well that’s just how it’s encoded someone told me how to switch between the two idk

oq-x avatar Oct 22 '24 02:10 oq-x

Gotta rework it then, check my pull request man. I added some guide for the server installation.

ghost avatar Oct 22 '24 14:10 ghost