Radians vs. Degrees
William Park
opengeometry at NOSPAM.yahoo.ca
Mon Jul 15 16:25:51 EDT 2002
Jef <plungermonkey at cox.net> wrote:
> Hi All,
>
> I'm new to this NG so please bear with me :-) I'm writing an addon
> for the Quake2 editor named QuArK and could use some advice from the
> math/coding gurus out there.
>
> My problem is that I'm trying to create a torus (donut) and the C
> code I'm looking at uses DTOR to convert degrees to radians and I see no
> mention of it (DTOR) in Python. My question is whether I need this in
> Python
Yes, everything is in radian.
> or does Python automatically convert to radians during calculations?
No, you have to do that yourself... rad/pi = deg/180
> Also, do the FOR loops work the same as in C++ (e.g. FOR(x=0, x<360,
> x++))? If not, any suggestions on how to do this?
In Python, it would go like
for i in range(360):
...
--
William Park, Open Geometry Consulting, <opengeometry at yahoo.ca>
8-CPU Cluster, Hosting, NAS, Linux, LaTeX, python, vim, mutt, tin
More information about the Python-list
mailing list