jeady / stat-2b

1 stars 0 forks source link

venn diagram area calculated inexactly #8

Open jeady opened 11 years ago

jeady commented 11 years ago

When the user selects the size of A or B using the sliders or text fields, the area they should have is calculated using floating point math. The width and the height of the actual html rectangles, however, must be integers. For example, with P(A)=35% and P(B)=20% and we get size of A is exactly 20160 but approximated as 20034, and the size of B is exactly 11520 but approximated as 11440.

This means that odd behaviors occur where the calculated intersection of the two rectangles is inconsistent with the user-specified size when AB=A or AB=B.