I suspect that Chris expects the arguments to asin and sin to be in degrees
Formula
|
10-02-2024, 10:19 PM
When you take the _Asin(sin(a)) I expected it to return the angle a.
It is returning everything between 0 and +|- 90 degrees, it may be right I never use _Asin(). OK Code: (Select All) ? sin(_pi/4), sin(_pi(3/4))
b = b + ...
10-02-2024, 10:24 PM
(10-02-2024, 10:19 PM)bplus Wrote: When you take the _Asin(sin(a)) I expected it to return the angle a. It won't though. Here's why: SIN (30) = 0.5 SIN (150) = 0.5 So _ASIN(0.5) is going to tell you it's 150... How? Same SIN value, same ASIN angle returned.
10-03-2024, 12:14 AM
"How?"
Don't tell, offer the 2 choices: Code: (Select All) Print ArcSinDegrees$(Sin(_Pi / 4))
b = b + ...
10-03-2024, 08:59 AM
Thanks for Your advice. This code works.
I# = _R2D(_ASIN(F# * Sin(_D2R(H#)))) Regards - Chris
Glad you have it worked out.
I got a new ArcSin function out of it now I need to figure out what to do with a Function with 2 answers to it Probably not acceptable to math definition of function but this one tells the whole truth of what the angle might be.
b = b + ...
10-03-2024, 06:18 PM
(10-03-2024, 02:39 PM)bplus Wrote: Glad you have it worked out. You'll never know what the angle might be. _ASIN(0.5) -- this might be 30 degrees. It might be 150. It might be 390 degrees. It might be 510. Ot could be -330. Or maybe -210.... So when you hit the _ASIN button, it tells you the first and simplest value that it can be -- 30 degrees. You can never confer that angle back from the value alone, multiple angles all return that same sine value.
It's always one of 2 angles as I showed in reply #15, except at pi/2 and -pi/2, saying it is from one angle only is incomplete answer.
b = b + ...
I like to do things "straight stick," so to speak. Try this stuff out to your heart's content.
Code: (Select All) _Title "Test sine, cosine, arcsin, arccos functions" Thing is, it's really simple to convert radians to degrees or degrees to radians. Radians * 180/pi = degrees. Degrees * pi/180 = radians. Seems easier than remembering the spacial function name, to me. (Typo corrected. I saw I was printing out the y angle twice at the end, as opposed to y and then z. Sorry. This works right.) Just so you can see why these formulas hold, simple derivation. Question: How many radians is 30 degrees? Answer consists of simple algebra: 2pi / 360 = xradians / 30 Solve for xrad xrad = 30 * pi/180 xrad = 0.5236 radians Or the other way around. How many degrees is pi radians? Answer: 2pi / 360 = pi radians / x Solve for x (cross multiply) 2pi * x = 360 * pi radians x degrees = pi radians * 180/pi x = 180 degrees |
« Next Oldest | Next Newest »
|
Users browsing this thread: 3 Guest(s)