#import "ViewControllerSettings.h"
#define DEGREES(radians) (radians * 180 / M_PI)
NSLog(@"%f", sinFita);
sinFita = asin(DEGREES(sinFita));
NSLog(@"%f", sinFita);
返回
2014-04-20 22:10:09.916 ---[8561:60b] 0.239580
2014-04-20 22:10:09.920 ---[8561:60b] nan
我要求我的答案以 Degreesº 为单位,并且使用了 double
。
答案应该是13.86º
最佳答案
asin
参数应该以弧度而不是度为单位,并且 asin
返回的结果也是以弧度为单位,因此您需要按如下方式执行它:
sinFita = DEGREES(asin(sinFita)); // Be aware that sinFita will now be in degrees and not in radians once this line is executed
关于ios - objective-C ;问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23187641/