Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

let's say, this is your bbox:

< -- w -->

0 _______ 1   ^
|         |   |
|         |   h
|         |   |
3 _______ 2   v

if i understand you right, you want to know the width & height of it ?

  w = sqrt( (p1.x-p0.x)*(p1.x-p0.x) + (p1.y-p0.y)*(p1.y-p0.y) );
  h = sqrt( (p2.x-p1.x)*(p2.x-p1.x) + (p2.y-p1.y)*(p2.y-p1.y) );

in other words, it's just the euclidian norm.