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.

Newcomers DBPro Corner / can someone help explain cos, sin, tan and so on ...

Author
Message
elie
20
Years of Service
User Offline
Joined: 12th Sep 2004
Location:
Posted: 7th Feb 2005 17:29
i want to write a program that draws a circle ( or a user defined part of a circle ) one pixle at a time. I think i have to use commands such as sin, cos & tan but im not sure what each one represents and the description in the manual look pretty simular.

please help as im going round in circles ( he he ) with this problem
elie
20
Years of Service
User Offline
Joined: 12th Sep 2004
Location:
Posted: 7th Feb 2005 18:11
sorry i dont think i described what i wanted to acheive very well -

i have 2 points on the screen x1,y1 & x2,y2 i want to draw a curved line between these 2 points.
Cyril Grey
19
Years of Service
User Offline
Joined: 28th Jan 2005
Location:
Posted: 7th Feb 2005 22:48
look in your 10th grade geometry book

With math all things are possible
Robot
20
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 8th Feb 2005 01:19
10th grade! I would like to know as well...but have no 10th grade geometry book.

The happenings of tommorow are behind us now
Mystery Coffee Drinker
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location: London
Posted: 8th Feb 2005 01:35
Use Sin if you know the Opposite Length and the Hypotenuese (sp?)
Use Cos if you know the Adjacent Length and the Hypotenuese (sp?)
Use Tan if you know the Opposite Length and the Adjacent Length

to draw a circle one pixel at a time you will also need to know the Radius.

I really can't remember the formula atm (at work) sorry

M.C.D
P4 3.02 1gig DDR Radeon 9600 Windows XP Home
Zokomoko
22
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 8th Feb 2005 02:09
I don't know they terms used to describe in english, so I wouldn't be able to explain really well, but maybe this drawing will help.

But I don't know how that's relevant to a circle.

Attachments

Login to view attachments
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 8th Feb 2005 02:16 Edited at: 8th Feb 2005 02:20


Multiplayer DLL on its way! Easy to use DLL for client/server multiplayer games.
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 8th Feb 2005 03:49
So are you trying to create splines?

[url]andrewneale2004@yahoo.com[/url]
http://www.freewebs.com/elbsoftware/index.htm
Dodo
20
Years of Service
User Offline
Joined: 8th Aug 2004
Location: eating lunch
Posted: 8th Feb 2005 05:09 Edited at: 8th Feb 2005 05:10
what sin (sine) does is to return a value between 0 and 1. for example, sin(90) returns one, and sin(0) returns 0. However, cos (cosine) is the opposite of sin, so cos(90) returns 0 and cos(0) returns 1. No matter how high the number is, sin and cos will always return a value between 0 and 1. If you drew graphs of them, they would look a bit like this:

sine



cosine



However, Tan (tangent) is different. It too returns a curve, but at 180 it shoots down to minus infinity, and at -180 it shoots up to infinity, then repeating for ever, just like cos or sin.

if you wanted to work out a curve, you would probably use sin and cos together, like Benjamin has done.

Part of solving the problem is actually noticing that the problem is there in the first place

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 8th Feb 2005 07:08
we just learned this in geometry:

SOH CAH TOA
Sine if you have the opposite side (from the angle) or hypotonuse and need the opposite side or hypotonuse, whichever u dont have

Cosine if you have one of the adjacent legs to the angle u use the cosine with or the hypotonuse and need the other

Tangent if you have the opposite side of the angle or the adjacent and need the other

hope that helps

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
The Game Programmer
19
Years of Service
User Offline
Joined: 4th Dec 2004
Location: Sitting, and waiting, and staring, and..
Posted: 8th Feb 2005 07:57
Wow, I feel smart... I learned this back in 7th grade. Now, 2 years later, I'm stuck in precalc...

Well, I'm trying aren't I.....

When Life gives you lemons make orange juice. Then sit back and wonder how it was done.
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 8th Feb 2005 09:34 Edited at: 8th Feb 2005 09:34
yeah i can't believe ur taking precalc as a Freshman!! I wont take that till 11th grade! I'm just now taking Geometry, and im in honors! What country do u live in?

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
elie
20
Years of Service
User Offline
Joined: 12th Sep 2004
Location:
Posted: 8th Feb 2005 16:52
thanks guy it helped a lot i realy apreciate it - ( i probaly did learn all that at school - but 15 yrs on ive only just had to use the information ).
Foxy
19
Years of Service
User Offline
Joined: 4th Jan 2005
Location: The Dale, South Australia
Posted: 8th Feb 2005 17:11
Quote: "I feel smart... I learned this back in 7th grade"


Hmmm, dang area schools in Aus. I'm in 9th grade and at the start of the year we are revising fractions *gasp from crowd* *sigh*.

Quote: ""Stay in School kids" - Mr education guy"


If I were you and you were me, then you'd be yourself 'cos you are me and I am you.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 9th Feb 2005 14:32
precalc in freshman year isn't all that uncommon.

"eureka" - Archimedes
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 11th Feb 2005 11:18 Edited at: 11th Feb 2005 11:18
hehe, do u live in the US? cause youd have to be in honors and 2 grades ahead to be in precalc as freshman where i live, and when do u get algebra 1 and 2 and geometry and pre-algebra?

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.

Login to post a reply

Server time is: 2024-11-27 21:37:08
Your offset time is: 2024-11-27 21:37:08