Paolo1956
LOREM IPSUM
- Registrato
- 20/6/10
- Messaggi
- 7.132
- Punti reazioni
- 939
Salve prof.!
Tié, un ricordo di quando mi occupavo attivamente di programmare...
Codice:
Private Function MinuteToPoint(ByVal _minute As Integer, ByVal center As Point, ByVal radius As Integer) As Point
Dim angle As Double
_minute *= 6
angle = (270 + _minute)
If angle >= 360 Then angle = angle - 360
angle = ((angle / 180) * System.Math.PI)
Dim p_x As Double = System.Math.Cos(angle) * radius * BORDER_MINUTE + center.X
Dim p_y As Double = System.Math.Sin(angle) * radius * BORDER_MINUTE + center.Y
Return New Point(CInt(p_x), CInt(p_y))
End Function
Private Function HourToPoint(ByVal _hour As Integer, ByVal _minute As Integer, ByVal center As Point, ByVal radius As Integer) As Point
Dim angle As Double
_hour *= 30
angle = (270 + _hour)
angle = angle + (_minute / 60) * (360 / 12)
If angle >= 360 Then angle = angle - 360
angle = ((angle / 180) * System.Math.PI)
Dim p_x As Double = System.Math.Cos(angle) * radius * BORDER_HOUR + center.X
Dim p_y As Double = System.Math.Sin(angle) * radius * BORDER_HOUR + center.Y
Return New Point(CInt(p_x), CInt(p_y))
End Function