mathematical functions?
mathematical functions?
- Subject: mathematical functions?
- From: Funkaster <email@hidden>
- Date: Mon, 14 May 2001 22:25:02 -0400
How can I access mathematical functions from cocoa?
what I've done so far (dunno if it's good):
for (int i=0; i < total; i++) {
theta = [NSDecimal decimalNumberWithDecimal:(ang * 3,14159 /
180.0) * i/ total];
NSDecimalPower(r, theta, int power, NSRoundUp);
radio = [NSDecimal decimalNumberBySubstracting:[NSDecimal
decimalNumberWithDecimal:1.0]];
}
what I want to do: (java)
for (int i=0; i < total; i++) {
double theta = (ang * Math.PI/180.0)*i/total;
double r = Math.pow(base,theta) - d;
double x = (int)r * Math.cos(theta);
double y = (int)r * Math.sin(theta);
}
how can I do this in Objective-C?
Thanks a lot,
fky