|
59 | 59 | }, |
60 | 60 | grid: true, |
61 | 61 | data: [{ fn: 'sqrt(1 - x * x)' }, { fn: '-sqrt(1 - x * x)' }] |
62 | | -})</code></pre></div></div><div class="col-md-6 center-block demos"><span id="grid" class="graph"></span></div></div></div></div><div class="example"><div class="container"><div class="row"><div class="col-md-6"><div class="comment"><h3>Domain</h3> |
| 62 | +})</code></pre></div></div><div class="col-md-6 center-block demos"><span id="grid" class="graph"></span></div></div></div></div><div class="example"><div class="container"><div class="row"><div class="col-md-6"><div class="comment"><h3>Polar coordinate grid</h3> |
| 63 | +<p>Polar equations use Cartesian axes by default. Set <code>coordinateSystem: 'polar'</code> |
| 64 | +to draw a polar grid with equal x/y units instead. <code>polar.grid</code> defaults to |
| 65 | +<code>true</code>, while angular labels are opt-in with <code>polar.angularLabels: true</code>. |
| 66 | +Labels use radians by default; <code>angleUnit: 'degrees'</code> changes their format.</p></div><div class="code"><pre><code class="javascript">functionPlot({ |
| 67 | + target: '#polar-grid', |
| 68 | + coordinateSystem: 'polar', |
| 69 | + polar: { |
| 70 | + radiusDomain: [0, 3], |
| 71 | + angularLabels: true |
| 72 | + }, |
| 73 | + data: [ |
| 74 | + { |
| 75 | + r: '2 * sin(4 * theta)', |
| 76 | + fnType: 'polar', |
| 77 | + graphType: 'polyline' |
| 78 | + } |
| 79 | + ] |
| 80 | +})</code></pre></div></div><div class="col-md-6 center-block demos"><span id="polar-grid" class="graph"></span></div></div></div></div><div class="example"><div class="container"><div class="row"><div class="col-md-6"><div class="comment"><h3>Domain</h3> |
63 | 81 | <p>The domains of both axes can be changed with the following configurations:</p> |
64 | 82 | <ul> |
65 | 83 | <li><code>xDomain</code>, defaults to <code>[-7, 7]</code></li> |
|
540 | 558 | instead of rectangles generated by the interval-arithmetic sampler set |
541 | 559 | <code>graphType: 'polyline'</code> which uses the normal single point evaluation</p></div><div class="code"><pre><code class="javascript">functionPlot({ |
542 | 560 | target: '#polar-circle', |
| 561 | + coordinateSystem: 'polar', |
| 562 | + polar: { |
| 563 | + radiusDomain: [0, 3], |
| 564 | + angularLabels: true |
| 565 | + }, |
543 | 566 | yAxis: { domain: [-1.897959183, 1.897959183] }, |
544 | 567 | xAxis: { domain: [-3, 3] }, |
545 | 568 | data: [ |
|
554 | 577 | graphType: 'polyline' |
555 | 578 | } |
556 | 579 | ] |
557 | | -})</code></pre></div></div><div class="col-md-6 center-block demos"><span id="polar-circle" class="graph"></span></div></div></div></div><div class="example"><div class="container"><div class="row"><div class="col-md-6"><div class="comment"><h3>Polar equations <div class="small">Polar rose</div></h3> |
558 | | -<p>Rendering the equation of the polar rose</p> |
559 | | -<p>$$ |
560 | | -r = 2 sin(4 \theta) |
561 | | -$$</p></div><div class="code"><pre><code class="javascript">functionPlot({ |
562 | | - target: '#polar-complex', |
563 | | - yAxis: { domain: [-1.897959183, 1.897959183] }, |
564 | | - xAxis: { domain: [-3, 3] }, |
565 | | - data: [ |
566 | | - { |
567 | | - r: '2 * sin(4 theta)', |
568 | | - fnType: 'polar', |
569 | | - graphType: 'polyline' |
570 | | - } |
571 | | - ] |
572 | | -})</code></pre></div></div><div class="col-md-6 center-block demos"><span id="polar-complex" class="graph"></span></div></div></div></div><div class="example"><div class="container"><div class="row"><div class="col-md-6"><div class="comment"><h3>Implicit functions</h3> |
| 580 | +})</code></pre></div></div><div class="col-md-6 center-block demos"><span id="polar-circle" class="graph"></span></div></div></div></div><div class="example"><div class="container"><div class="row"><div class="col-md-6"><div class="comment"><h3>Implicit functions</h3> |
573 | 581 | <p>The equation of a circle of radius 1 $x^2 + y^2 = 1$ expressed in an explicit way is:</p> |
574 | 582 | <p>$$ |
575 | 583 | y = \sqrt{1 - x^2} \quad and \quad y = -\sqrt{1 - x^2} |
|
0 commit comments