Permalink
Browse files

Use fractions internally in circles_and_arcs and areas_of_circles_and…

…_sectors to avoid precision error
  • Loading branch information...
1 parent dc17a4f commit a386b6c2cb6e8cce8bac3d9ebf9c365412cfce2f @osnr osnr committed Jul 13, 2012
Showing with 6 additions and 6 deletions.
  1. +4 −4 exercises/areas_of_circles_and_sectors.html
  2. +2 −2 exercises/circles_and_arcs.html
@@ -11,16 +11,16 @@
<var id="R">randRange(5, 10)</var>
<var id="C">2 * Math.PI * R</var>
- <var id="PRETTY_C">piFraction(C)</var>
+ <var id="PRETTY_C">2 * R + "\\pi"</var>
<var id="S">ANGLE/360 * C</var>
- <var id="PRETTY_S">piFraction(S, true, 0.0001)</var>
+ <var id="PRETTY_S">fractionReduce(ANGLE * C, 360) + "\\pi"</var>
<var id="A_C">PI * R * R</var>
<var id="A_S">ANGLE/360 * A_C</var>
- <var id="PRETTY_A_C">piFraction(A_C)</var>
- <var id="PRETTY_A_S">piFraction(A_S, true, 0.0001)</var>
+ <var id="PRETTY_A_C">R * R + "\\pi"</var>
+ <var id="PRETTY_A_S">fractionReduce(ANGLE * R * R, 360) + "\\pi"</var>
<var id="ROTATE_ARC">randRange(0, 359)</var>
</div>
@@ -11,13 +11,13 @@
<var id="R">randRange(5, 10)</var>
<var id="C">2 * Math.PI * R</var>
- <var id="PRETTY_C">piFraction(C)</var>
+ <var id="PRETTY_C">2 * R + "\\pi"</var>
<var id="ROTATE_ARC">randRange(0, 359)</var>
<var id="A">ANGLE/360 * C</var>
- <var id="PRETTY_A">piFraction(A)</var>
+ <var id="PRETTY_A">fractionReduce(ANGLE * 2 * R, 360) + "\\pi"</var>
</div>
<div class="problems">

0 comments on commit a386b6c

Please sign in to comment.