[android-developers] Re: Math.Sin(90) doesn't return 1?

2009-02-01 Thread Romain Guy
Or use Math.toRadians() On Feb 1, 2009 12:49 PM, "Mark Murphy" wrote: Phill Midwinter wrote: > Ah > > So I just multiply by pi over 180? That should work. -- Mark Murphy (a Commons Guy) http://commonsware.com Android Training on the Ranch! -- Mar 16-20, 200... --~--~-~--~~

[android-developers] Re: Math.Sin(90) doesn't return 1?

2009-02-01 Thread Mark Murphy
Phill Midwinter wrote: > Ah > > So I just multiply by pi over 180? That should work. -- Mark Murphy (a Commons Guy) http://commonsware.com Android Training on the Ranch! -- Mar 16-20, 2009 http://www.bignerdranch.com/schedule.shtml --~--~-~--~~~---~--~~ Yo

[android-developers] Re: Math.Sin(90) doesn't return 1?

2009-02-01 Thread Phill Midwinter
Ah So I just multiply by pi over 180? Cheers! 2009/2/1 Mark Murphy > > ph...@grantmidwinter.com wrote: > > > > input: > > Log.v("sintest",String.valueOf(Math.sin(90))); > > > > output: > > V/sintest (16869): 0.8939966636005579 > > > > huh? I realise I'm probably about to invite explanation

[android-developers] Re: Math.Sin(90) doesn't return 1?

2009-02-01 Thread Mark Murphy
ph...@grantmidwinter.com wrote: > > input: > Log.v("sintest",String.valueOf(Math.sin(90))); > > output: > V/sintest (16869): 0.8939966636005579 > > huh? I realise I'm probably about to invite explanations about > floating points and subsequent brain explosions, but could anyone tell > me what's

[android-developers] Re: Math.Sin(90) doesn't return 1?

2009-02-01 Thread Christoph Studer
According to the doc: http://code.google.com/android/reference/java/lang/Math.html#sin(double) you need to provide the angle in radians, where 2*Pi corresponds to 360 degrees (i.e. Pi/2 is 90 deg). http://en.wikipedia.org/wiki/Radian In Java, you can use the constant Math.PI for Pi. Christoph

[android-developers] Re: Math.Sin(90) doesn't return 1?

2009-02-01 Thread Phill Midwinter
V/sintest (21227): -0.8011526357338304 And that's Sin(180) ? 2009/2/1 ph...@grantmidwinter.com > > > input: > Log.v("sintest",String.valueOf(Math.sin(90))); > > output: > V/sintest (16869): 0.8939966636005579 > > huh? I realise I'm probably about to invite explanations about > floating points a