Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Beyond the Humans Knowledge
15
Years of Service
User Offline
Joined: 27th Oct 2010
Location:
Posted: 6th Nov 2010 06:36
I am going to make a program that figures out sin cos and tan. i want to put an image up there for side a b c and A B C then be able to input the sides and angles. when i do this it will tell me the side of every angle and side! but how would i be able to input where i want to and show the image?

onhcet d(-_-)b techno
SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 6th Nov 2010 06:39
Try reading some toutorials for i/o, as for the rest I'm not really shure what your asking.
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 6th Nov 2010 08:18 Edited at: 6th Nov 2010 08:19
Well... trigonometric functions are by nature *transcendental*. This means that you cannot express these functions in a finite number of algebraic functions (addition, subtraction, multiplication, division, and exponentiation). For example:



(all x is in radians. This is why mathematicians use radians! degrees are arbitrary numbers, we might as well have degrees from 9 to 42, as soon as 0 to 360!)
These are *infinite* series. So, if I gave you a number, X, and i wanted you to find cos^(-1)(x) in a finite number of operations, you *couldn't do it* for the general case. Sure there are exceptions like cos^(-1)(1)=0, but thats just one case. For this reason, people always use weird approximations, with odd constants and stuff. So if you want to solve for the inverse cosine, sine, or tangent yourself, have fun, but it takes calculus.

As for just finding the values... I'm extremely sorry... but I couldn't resist and wrote a program up



Beyond the Humans Knowledge
15
Years of Service
User Offline
Joined: 27th Oct 2010
Location:
Posted: 6th Nov 2010 18:11
dude this is awesome! i tried it and it worked. so when it shows the angles of sin cos and tan, those are the angles of all of them. so if i put in cos to figure out the tan angle, it would be where ever i left the mouse?

onhcet d(-_-)b techno
Beyond the Humans Knowledge
15
Years of Service
User Offline
Joined: 27th Oct 2010
Location:
Posted: 6th Nov 2010 18:16
what exactly is the sin (ang) and all the other stuff, what does that tell me?

onhcet d(-_-)b techno
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 6th Nov 2010 23:41 Edited at: 6th Nov 2010 23:41
Well... Whenever I'm doing something mathematical in a program, I try to make up my own coordinate system. In this case, I wanted the screens bottom left corner to be at <-1,-1>, and its top right corner to be <1,1>. The center of the screen is at <0,0>.

That means that if you said:
screenLine(-1,-1,1,1)
a line would be drawn from the bottom left corner of the screen to the top right corner of the screen.

So, now we can imagine the screen to be a coordinate plane, viewed from -1 to 1 on both the x and y axes. posX and posY represent the mouse's coordinates in this system.

So, in a right triangle with sides a,b, and h, where a is the adjacent side and b is the opposite side:
cos(x)=a/h=posx/(posx^2+posy^2)
sin(x)=b/h=posy/(posx^2+posy^2)
tan(x)=b/a=posy/posx

Here's some code that illustrates that better:




So, in short, all that other stuff just transforms my coordinate system (from <-1,-1> to <1,1>, to screen coordinates (from <0,0> to <screen width(), screen height()>, because I think its simpler to treat coordinates that way.


Hmm... Are you familiar with using sine, cosine, and tangent? I had a hard time connecting all the different things like the unit circle, weird wavy graphs, and direction, when I started learning about trig stuff.

Beyond the Humans Knowledge
15
Years of Service
User Offline
Joined: 27th Oct 2010
Location:
Posted: 7th Nov 2010 01:52
ya im familiar with it. im in pre cal right now so i can understand it.

onhcet d(-_-)b techno

Login to post a reply

Server time is: 2026-07-26 05:03:19
Your offset time is: 2026-07-26 05:03:19