[Bf-python] radians in the api [was Re: [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11267] ...]
Joe Eagar
joeedh at gmail.com
Sun Jul 15 08:58:01 CEST 2007
Stephen Swaney wrote:
> Best to do all the angles in the api in radians.
>
> If this were a presentation layer like the gui, doing
> them in degrees (or deci-degrees like the ipos) makes some
> sense because users are more familiar with them.
> (iirc, at one time at least some of the ui values were
> in radians because I remember someone asking on the forum
> why they were getting weird rotation values)
>
> However, this is a programming api. Any time you break
> consistency, you end up with one more detail to keep track
> of in your head. Do this often enough and you end up with
> a head full of junk and frequent trips to the docs.
>
> If you are creating user interfaces via py you can present
> them in degrees with the always handy radians() & degrees()
> converters in the math module.
>
>
>> One thing is sure - We do NOT want to mix both.
>>
>
> Yep. Radians, radians, radians.
>
>
I agree. I also don't think lamps and cameras should use degrees. It
simply breaks consistency, which means
that while simpler scripts are easier, you have to convert *to* radians
in more complex ones, like if your feeding
the camera lens based on rotation of another object.
Joe
More information about the Bf-python
mailing list