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.

DarkBASIC Professional Discussion / Circle maths help?

Author
Message
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 8th Mar 2011 20:48 Edited at: 8th Mar 2011 20:49
I have got so far in getting my line near the circle but I don't know what maths I need to make if do an oval circle.

see picture


now I am trying to get the white lines to join to the two magenta circle to that it would look like clock minute markers but with odd angles.

heres the code, problem near lines 78



Dark Physics makes any hot drink go cold.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 9th Mar 2011 15:13
Hey there HowDo! Not sure "Newcomers" is the right area for this post is it? You'd get a better answer on the main DBP thread.

My knowledge of elipses is not so great though, sorry!

Struggling to understand and get through all this personally. I imagine @SvenB or someone similar might be a good person to ask.

HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 9th Mar 2011 15:46
thats what I wonderd after I press post, and then saw I was in the wrong place.

can a mod still move these post to right place.

If not I'll re post again after a few days.

Dark Physics makes any hot drink go cold.
LBFN
19
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 9th Mar 2011 16:16 Edited at: 9th Mar 2011 16:17
Diggsey posted a code snippet a long time ago that draws filled ellipses. Perhaps it would be of some help to you. Here is the link:
http://forum.thegamecreators.com/?m=forum_view&t=98689&b=6

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 10th Mar 2011 16:50
thanks IanM

Dark Physics makes any hot drink go cold.
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 10th Mar 2011 22:18


And if you need to work out the angle used for those equations, you can use atanfull.

The Internet: Where men are men, women are men, and children are federal agents
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 11th Mar 2011 19:22 Edited at: 11th Mar 2011 19:24
I think my wording is getting some confused as to what I would like to do.

have a look here to see what I mean, its the circle with the zodiac signs on it that I am trying to re produce .

http://en.wikipedia.org/wiki/File:Schema_Orloj_pragueorlojhzenilc.jpg

If it can be done with above demo code I can't see how I would do it.

Dark Physics makes any hot drink go cold.
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 11th Mar 2011 21:45 Edited at: 11th Mar 2011 21:50
wait so should the lines go from the outer blue circle to the inner blue circle? I don't see anything magenta :S
OH WAIT i see what you mean now!



tharr! so use the circleclip_line() function to draw from the outer circle, to the points inside the inner circle.

circleclip_line draws a line from p1 to p2, but if the line P1P2 intersects the circle (defined by C and radius), it only draws FROM p1 to the circle's border.

All I did was take a parametric line from P1 to P2, solve for the point where the line intersects the circle, and then draw from p1 to that point.

[edit]
that demo actually looks pretty cool, lol


Login to post a reply

Server time is: 2026-07-15 03:39:56
Your offset time is: 2026-07-15 03:39:56