I hear sin() and cos() are inaccurate.

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by halo.

I wrote a plugin for my editor to make a cylinder of any number of sides. However, my shapes are coming out all lopsided. Could PB's sin and cos functions be to blame?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Pupil.
I wrote a plugin for my editor to make a cylinder of any number of sides. However, my shapes are coming out all lopsided. Could PB's sin and cos functions be to blame?
Well you can easily compare PB's result with that of a scientific calculator if they differ significantly one of them is wrong, fortunately most calculators don't give wrong answers.....

Also make sure that you use radians for the angle and not degrees i.e:
1 [degree] = 2*pi/360 [radian]


Edited by - Pupil on 04 August 2002 11:27:16
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by halo.

Yeah, I was using degrees...you should have seen the lopsided cylinders that were coming out of this! Works perfectly now.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Branston.

"I Hear Sin() and Cos() are inaccurate"

Just out of curiosity where did you hear that? :wink:
Post Reply