Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Center point of arc

Posted on 2001-08-17
5
Medium Priority
?
1,600 Views
Last Modified: 2006-11-17
I've one more question please.
 There is an arc having 11 x,y points. How to calculate coordinates of center of this arc?

Thanks.
 
0
Comment
Question by:mansan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 6

Accepted Solution

by:
kotan earned 105 total points
ID: 6399780

centerX = sum(x1,x2,...,x11)/11;
centerY = sum(y1,y2,...,y11)/11;

centerpoint is (centerX, centerY)
0
 

Expert Comment

by:kartik
ID: 6399879
Suppose (x,y) are the co-ordinates of the centre of arc.
Let (x1,y1) and (x2,y2) be two of the points on arc.
Then :
(x-x1)^2+(y-y1)^2=r^2 where r is the radius.
(x-x2)^2+(y-y2)^2=r^2
So equate these two equations to get the centre of circle which (x,y)
With regards,
V.Kartik
0
 
LVL 7

Expert Comment

by:peterchen092700
ID: 6400022
..and you shouldmake sure all pairs result in the same centerpoint
0
 
LVL 1

Expert Comment

by:glebspy
ID: 6400233
Sorry, that ain't right.

Given any two points, there are an infinite number of different arcs that pass through both.

You can see this because if you do what kartik suggested, you get:

(x-x1)^2+(y-y1)^2=(x-x2)^2+(y-y2)^2

1 equation with 2 unknowns (x and y) has an infinite number of solutions.


So you need *three* points, from which you can get *two* equations:

(x-x1)^2+(y-y1)^2=(x-x2)^2+(y-y2)^2
and
(x-x1)^2+(y-y1)^2=(x-x3)^2+(y-y3)^2

and now you really can solve for x and y.



kotan answered the question `how do I find the center of mass of the arc' rather than `how do I find the center of the circle of which the arc belongs to' .. if that was what you intended, then his answer is correct.
0
 

Author Comment

by:mansan
ID: 6404986
Thanks you all for kind help.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question