views:

180

answers:

3
+1  Q: 

2D Shape Scaling

Hi well I got a problem about scaling shapes.Well I m trying to scale two similar shapes.It is in 2d and each shape has n points .I found a statement like this from a paper I read

"The size of a shape is the root mean square distance between the shape points and it's centroid."

So from this point if I calculate the size of both shapes S1 and S2 and lets say S1=xS2 so if I create scaling matrix like this

[x 0] [0 x]

(i just wrote 2x2 matrix i know it should be different) and if I mulitply it with S2 are their shapes aligned? Thx

A: 

It reminds me of Fant's Resampling Algorithm, smooth... Not sure it fits your question.

Havenard
A: 

If I'm understanding what you wrote, then multiplying your matrix by a shape, (say, S2) will scale Each of S2's points by a factor of x.

This says nothing about their alignment. this paper might help your understanding if you want to do it efficiently

Alex
well I thought like that too but I dont know. looking for that paper you gave link to.thx
Emre
+1  A: 

Well I think I found a solution .It is done using a scale metric instead of real scale value.

if the shape 3 points (x1,y1) (x2,y2) (x3,y3) a scale metric S is square root of sum of each points squared values like

mean x=(x1+x2+x3)/3

mean y=(y1+y2+y3)/3

S=((x1-x)^2 +(y1-y)^2+(x2-x)^2 +(y2-y)^2+(x3-x)^2 +(y3-y)^2)^1/2

and if this scale metric is calculated for both shapes there will be an equation like this S1=AS2

and if all points of shape 2 is multiplied with value of A they will have similar shapes.

Emre
anyone want to comment?
Emre
well there is a small mistake here i ll update it. right now this just works when both shapes are centered at origin
Emre