Problem in if comparison

  • Thread starter sridhartv25@gmail.com
  • Start date
S

sridhartv25@gmail.com

Guest
Hello all,

I am trying to write a skill program for converting regular polygon to
path,
in this program I have compared the bBox of the polygon with the bBox
of the created path,if both are equal then only the path is created.
The Problem in this comparison is that ,I am not able to convert 45
deg polygon to path
because of minor mismatch in their bBox's ,may be 1 or 2 % , how can I
compare the bBox's such that the condition is valid even for 1 or 2 %
mismatch.
 
sridhartv25@gmail.com wrote, on 01/19/09 13:04:
Hello all,

I am trying to write a skill program for converting regular polygon to
path,
in this program I have compared the bBox of the polygon with the bBox
of the created path,if both are equal then only the path is created.
The Problem in this comparison is that ,I am not able to convert 45
deg polygon to path
because of minor mismatch in their bBox's ,may be 1 or 2 % , how can I
compare the bBox's such that the condition is valid even for 1 or 2 %
mismatch.
Er, isn't that obvious? Do a comparison of the values using a tolerance, as you
would with any close comparison - abs(val1-val2)<0.02*max(abs(val1) abs(val2)) -
that kind of things.

Andrew.
 

Welcome to EDABoard.com

Sponsor

Back
Top