Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 25th, 2005, 9:24 PM   #11
EverLearning
Hobbyist Programmer
 
EverLearning's Avatar
 
Join Date: May 2005
Location: Indiana
Posts: 130
Rep Power: 4 EverLearning is on a distinguished road
CHILL...

(x-a)^2 + (y-b)^2 = r^2
(x-a)(x-a) + (y-b)(y-b) = r^2
x^2 + (x)(-a) + (-a)(x) + a^2 + y^2 + (y)(-b) + (-b)(y) + b^2 = r^2
x^2 + y^2 + a^2 + b^2 + (x)(-a)^2 + (y)(-b)^2 = r^2
...err
in red is your error, it should be: - 2ax -2yb: (a - b)^2 = a^2 - 2ab + b^2.
do you HAVE to break it down like this? Language constraints? Why can't you use the one above with sqrt()? I have not programmed extensively with Python, so I'm not sure, but I can check in C/C++.

Quote:
Anyways. Yes, even when I change X, it doesn't consider it in the equation for some reason. I just get like 3.003450100000^e032 or something. I'm using Python.
what values for x are you using?
__________________
got math? yumm...

"All men by nature desire to know" -Aristotle, Metaphysics

Last edited by EverLearning; Jul 25th, 2005 at 9:39 PM.
EverLearning is offline   Reply With Quote
Old Jul 25th, 2005, 9:38 PM   #12
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,886
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Oh my bad, I thought (x-a)(x-a) = x^2 + (x)(-a)^2 + a^2. Fair enough.

And I don't understand your question, I am using your equation. Just from the X values ...oh my...I think I found the problem. :o , the X range was outside the radius, I thought the equation asked for A and B so that X and Y didn't need to be defined according to the position of the circle.

Okay, it should probably work then. Sorry for the bother.
Sane is offline   Reply With Quote
Old Jul 25th, 2005, 9:41 PM   #13
EverLearning
Hobbyist Programmer
 
EverLearning's Avatar
 
Join Date: May 2005
Location: Indiana
Posts: 130
Rep Power: 4 EverLearning is on a distinguished road
Feels good to find your own mistakes, know that feeling

cheers
__________________
got math? yumm...

"All men by nature desire to know" -Aristotle, Metaphysics
EverLearning is offline   Reply With Quote
Old Jul 26th, 2005, 1:00 AM   #14
Navid
Hobbyist Programmer
 
Navid's Avatar
 
Join Date: Feb 2005
Location: Canada
Posts: 187
Rep Power: 4 Navid is on a distinguished road
Send a message via MSN to Navid
wait...when you say "x^2", do you mean "x squared"?
Navid is offline   Reply With Quote
Old Jul 26th, 2005, 9:42 AM   #15
EverLearning
Hobbyist Programmer
 
EverLearning's Avatar
 
Join Date: May 2005
Location: Indiana
Posts: 130
Rep Power: 4 EverLearning is on a distinguished road
Quote:
Originally Posted by navnav
wait...when you say "x^2", do you mean "x squared"?
what do you think? does it look like an integral or smth?
Yes. It is one of the standard ways to express squarede entities without LaTex or superscript tags.
__________________
got math? yumm...

"All men by nature desire to know" -Aristotle, Metaphysics
EverLearning is offline   Reply With Quote
Old Jul 26th, 2005, 12:44 PM   #16
Navid
Hobbyist Programmer
 
Navid's Avatar
 
Join Date: Feb 2005
Location: Canada
Posts: 187
Rep Power: 4 Navid is on a distinguished road
Send a message via MSN to Navid
But then i can't see how x^2 + y^2 will always equal to 1 in the cordinates of a cirlce
Navid is offline   Reply With Quote
Old Jul 26th, 2005, 1:30 PM   #17
EverLearning
Hobbyist Programmer
 
EverLearning's Avatar
 
Join Date: May 2005
Location: Indiana
Posts: 130
Rep Power: 4 EverLearning is on a distinguished road
Quote:
Originally Posted by navnav
But then i can't see how x^2 + y^2 will always equal to 1 in the cordinates of a cirlce
It holds true for UNIT circle, used so much in your higschool trigonometry: r = 1 => r^2 = 1 so x^2 + y^2 = 1.
From general formula in post#3, RHS value is r^2.
Circle is defined as "graph" that consists of all points equidistant from the center, i.e. radius is that distance.
__________________
got math? yumm...

"All men by nature desire to know" -Aristotle, Metaphysics
EverLearning is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:34 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC