Too dumb to do the maths

BlitzMax Forums/BlitzMax Beginners Area/Too dumb to do the maths

I think you can use this
'angles must be between 0 and anglemax
Function AngleDifference#(angle1#,angle2#,anglemax=360)
	Local temp#

	temp#=angle2-angle1
	If temp>+anglemax/2 Then Return temp-anglemax
	If temp<-anglemax/2 Then Return temp+anglemax
	Return temp
EndFunction

howclosetorightangle=abs(90-abs(angledifference(a1,a2)))