Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
Hello everyone, Here I need a help in solving a system of equations in a loop statement.
I want to get the coordinates of intersection point of two circles,
one circle center coordinate (0,0),R=31.5
The other circle center coordinate (33.8 ,S) -54<S<150
how can I calculate all intersection points of two circles using Mathcad. Thank you
Solved! Go to Solution.
Find attached a Prime 9 sheet where you can chose a value y2 for the y-coordinate of the second circle center and get the two solutions along with a plot
and also a way to create a table with the 205 y2-values in the first column and the corresponding solutions in the other four columns
Hi,
Some circles do not intersect so NaN is used to identify them
The following identifies one intersection of a possible two for each circle.
Leave it to you to get the other intersection
AA=[ s xLow yLow ]
[ s xHigh yHigh ]
Evry s has two intersection points or no intersection point.
@Aary wrote:
Hello everyone, Here I need a help in solving a system of equations in a loop statement.
As far as I see in your sheet you are trying to solve 205 systems of two equations each with your loop!?
The other circle center coordinate (33.8 ,S) -54<S<150
Not according to your sheet!! There is in discrepancy! In your sheet the second coordinate of the second circle center is not S but rather s-54.26 which would mean that this center coordinate varies from -108.26 up to 95.74.
Please clarify and state what you actually need!
The difference can be seen here:
Both interpretations would give you all the same real solutions (slightly more than the right half of the first circle) but differ in the non-real results.
I also wonder what you intend to do with all the 820 values ...
BTW, you get real results for the points of intersection as long as the absolute value of y-coordinate of the second circle center is smaller than 1/10*sqrt(314781)=56.1....
how can I calculate all intersection points of two circles using Mathcad. Thank you
So ... are you looking just for a method to find the two points of intersection of two circles or are you looking for all 410 points?
If the latter is what you are looking for, you also would have to say what kind of data structure you have in mind for these 820 values (some real, some non-real)
Should it be a 205x4 matrix, or a 205x1 vector with 2x2 matrices as elements, or ....
Please specify what exactly you are looking for.
Using numeric methods like a solve block to solve the system will always only give you just one of the two possible solutions, as Terrys approach had shown. Which one of the two points of intersection you get depends on the guess values provided. Furthermore providing just real values as guesses will never give you non-real results but the solve block would rather throw an error. Terry catches the error with "try ... on error" and returns NaN's in that case.
Do you need the non-real values, too, in that case? Please clarify!
It would be possible to add the guess values as additional function to the solve block function and write a program which varies the guesses (maybe even non-real guesses so you also get the non-real results) so that you can catch both solutions.
Maybe ttokoro has done so. Unfortunately he always posts just pictures showing that he can do it but does not provide more information or the sheet. But I think, however, that he will submit the Prime Sheet later if requested - he just wants to be asked.
But given that the system of two quadratic equations is easy enough even for Primes symbolics, I would rather use the symbolics to find both solutions in one go without much fiddling around.
You could use a function like this:
The first column of the result matrix contains the x-coordinates, the second the y-coordinates.
Don't worry as of the red "error". It just says that the symbolic result is very large and Prime (unfortunately) refuses to display it. As you can see the result still can be used when you assign it a function.
You can also evaluate the function symbolically for a more precise result
To see the exact result you must avoid any floating point numbers as otherwise the symbolics switches in float mode automatically
Find attached a Prime 9 sheet where you can chose a value y2 for the y-coordinate of the second circle center and get the two solutions along with a plot
and also a way to create a table with the 205 y2-values in the first column and the corresponding solutions in the other four columns