# 5 points - mean centre.center

• posted
If I have 5 points how can I use autocad to determine the mean centre?
tia
• posted
hmmm
1. ssget or whatever to get the entities that define the points, but get a list of the points. 2. extract the 10's and or 11's from the dxf code, depending on type of entity 3. sum the x's and sum the y's and divide by 5 ( or "n" if your are writing generic) 4. (cons (+ x1 x2 x3 x4 x5)(+y1 y2 y3 y4 y5))
yes?
or if you need a 3d point (list (+ x1 x2 x3 x4 x5)(+y1 y2 y3 y4 y5((+z1 z2 z3 z4 z5))
seems like it might work.
must play now.
• posted
I am an auctocad beginner so I'll try
program code?
step in code
step in code
So this is the mean center! - very nice
what is this?
thanks very much easy for you, eh!
• posted
Select object: ((-1 . ) (0 . "LINE") (330 . ) (5 . "CB6D") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "WALLS") (100 . "AcDbLine") (10 832.0 697.5 0.0) (11 832.0 580.0 0.0) (210 0.0 0.0 1.0))
the (10 832.0 697.5 0.0) being dxf code for one endpoint and the (11 832.0 580.0 0.0) being the other endpoint. (11 832.0 580.0 0.0) is a 3d point, 11 being the "control" character used to search for the data, 832.0 corresponding to the x component, 580.0 being y, and since I draw without any positive elevation, z = 0.
the (0 . "LINE") means the entity I selected is a line, were it a circle it would say (0 . "CIRCLE").
so, if you know the type of entity, you can extract the numbers associated with the cartesian coordinates, x & y, and do the algebra.
but if you already have a single entity, like a closed polygon or better yet, a region, I think there are commands that will just hand you the centroid point. if not in the basic package, then an add in.
what kind of stuff are you drawing?
• posted
Makes an ordered (coordinate) pair, though I think he forgot to divide by 5.
• posted
When would you want something like this? Moving mechanical stuff?
• posted
Beginner - yes. I went to the local college, a few years ago, and took three autocad courses. But I've only had occasion to do a couple of drawings.
I shoot rifle at 100 and 200 yards. Object being to drill 5 shots into one hole. I shoot 5 x 5 shots per target. Now I'm interested in determining the mean centre for each 5 shot group. This will help me adjust the scope, which is 1/8" adjustable at 100yds. I made up the original targets using visio. Now I started drawing the groups on a visio template and got lost! I was trying to determine the centre diagrammatically draw intersecting lines & circles and going crazy. Guess I've forgotten all my algebra. Thought I'd move the problem over to autocad but still didn't know where to start. I knew if I asked this group I'd get the math to solve the problem. So thanks very much
• posted
I have no idea why Don wanted this. Have LISP, will code.
-Bill
=======
Oh, now I see his reply about target shooting. Unlike a centroid, finding the mean weights the result toward two points close together.
Michael Bulatovich wrote: > When would you want something like this? Moving mechanical stuff?
• posted
Thanks Bill
The pencil solutions will be helpful for roughing in a new scope at the range.
thanks again
Bill Gilliss wrote:

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.