Re: Trigonometric Problem, Particularly tan() Function
Re: Trigonometric Problem, Particularly tan() Function
- Subject: Re: Trigonometric Problem, Particularly tan() Function
- From: Michael Vannorsdel <email@hidden>
- Date: Sun, 13 Jul 2008 08:10:49 -0600
I don't think it's the cause but you should probably use tanf to avoid
value casting to and from a double.
On Jul 13, 2008, at 7:30 AM, Patrick Walker wrote:
I can't post the whole thing because it's sort of large and
"integrated" but here is what I have originally done.
float radians;
radians = ([entryField floatValue] * M_PI / 180);
[outField setFloatValue:tan(radians)];
A simple solution could involve using another trigonometgric
implementation available to Xcode. The question is are there any
other than the numerical method "math.h" versions? That's not so
bad because I can simply trap +- 90 and +-270 angles but I am trying
to get as much speed.
My other problems seems to be -2877334 itself. To me, that appears
to be a rather strange value for a floating point number, esp. when
cos(pi/2) is returning near-zero (an "e-08") number as well.
Thanks for the replies.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden