Skip to content

A question on function #23

@ghost

Description

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions