How do i rotate in degrees with Python?

When i do “N” to see location, etc…, and put number 1 in RotZ in that window, everything OK, but when i write in Python, it does a strange rotation (57.296)
Code:

import Blender
em = Blender.Object.Get(“Empty”)

em.RotZ = em.RotZ + 1.0

Blender.Redraw ()

And why is not possible to write < > [ ] these caracteres in text window?

Can someone help me?

The rotations in the Python API are in radians.

Martin

And you change with

degrees = 180 * radiants / pi

pi = 3.141592…

Stefano

thank you very much!

Very new in Blender and even more in Python.

One more question :o

Witch module do i have to load to get variable radiants?
I’ve search in “math” and could not found.

thank you!

herm

radiants are a Measure Unit like meters etc, not a variable :slight_smile:

They are the SI (Internationa System) unit for angles, like meter is for length, second for time etc.

radiants are a smart unit, defined recently, and 1 radiant is the angle defining on a circle an arc whose lenght is equal to the radius.

We use degrees from old Sumerian leftover.

Sumerians, for some strange reason used base 60 for numbering, whereas egypians base 10. The reason for 10 is probably because we have 10 fingers :slight_smile: and egyptian developed nice math on it.

60 on the othr hand is nicer because it can be divided evenly better. YOu can divide 10 by 5 ad 2 only, while you can divide 60 by 30, 15, 12, 10, 6, 5, 3, 2 So sumerians developed much better fractional system than egyptians. The remaining of their math is much interesting.

Sumerian astronomy passed through Assyrians, babilonians and Caldeans to Arabs and to the modern world, and hence the base 60 remained struck in star positioning. And sine star positioning is given in angles here you are a base 60 system.

Actually they passed from 60 to 360 since they need to divide day in 12 hours and night in 12 hours and they need a match between 24 and 60 and the minimun common multiple is 360 :slight_smile:

And fractions of degrees are given on 60 basis too :slight_smile: 60 minutes of arc = 1 degree, 60 seconds of arc = 1 minute :slight_smile:

Stefano

Thank you very much for your class, i’ve learn’d alot!!! :smiley:

(I think i’ve understood)
If i “put” the radius measure in top of circunference, no matter the size of the circunference (direct proportion), the angle is always the same!

After i got a help win a friend that work with me, i got the conversion.

If i whant to rotate 3 degrees, a can do that:

r = 3 #degrees to rotate
conversion = r * ( 2 * pi / 360)
object.RotZ = object.RotZ + conversion

Is correct ?

Thank you very much

Correct.

I actually prefear

r * pi / 180

because there is an operation less, and hence faster.

Stefano