|
||||||
| Forums FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Programming/Scripting Questions about programming, bash scripts, perl, php, cron jobs, ruby, python, etc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
From memory, I think you want the arcsine function:
a=asin(m(V - b)) |
|
||||
|
Thanks.
As i did like this way, which i know is wrong somehow. Code:
$a_x = sin(0.062763 * ($ch410 - (-0.19564))); $a_y = sin(0.062763 * ($ch411 - (-0.19564))); Quote:
Code:
$a_x = asin(0.062763 * ($ch410 - (-0.19564))); $a_y = asin(0.062763 * ($ch411 - (-0.19564))); Quote:
Quote:
Quote:
Any ideas?
__________________
Visit my website: http://anl4u.com Laptop: openSUSE 11.2 | KDE4.3.1 '6' | Kernel 2.6.31.5 | Intel Mobile 4 series graphic card | Intel centrino dual core 2.0Ghz Processor | 4GB RAM | 320GB HDD Last edited by mmarif4u; 22-Oct-2009 at 04:03. Reason: Adding.. |
|
|||
|
Remember that these trig functions usually expect input and generate output in radians, not degrees.
|
|
||||
|
Agree with ken_yap. It's arcsine (sin^-1) you need - working here:
a = sin(m(V - b)) sin^-1 (a) = sin^-1 (sin(m(V-b))) sin^-1 (a) = m(V-b) And yeah, you need to use radians, not degrees. Convert degrees to radians like this: radians = degrees * (pi/180). I'd use the math constant pi in php rather than use an approximation.
__________________
Happily using Linux since 1998 Share & Enjoy |
|
||||
|
Thanks guys for all your support and help.
That rad2deg did the job. PHP Code:
__________________
Visit my website: http://anl4u.com Laptop: openSUSE 11.2 | KDE4.3.1 '6' | Kernel 2.6.31.5 | Intel Mobile 4 series graphic card | Intel centrino dual core 2.0Ghz Processor | 4GB RAM | 320GB HDD |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|