Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small Fixes for plot Category in Chalkboard Documentation #1

Merged
merged 5 commits into from Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 9 additions & 9 deletions Chalkboard/documentation.html
Expand Up @@ -2031,7 +2031,7 @@ <h4>PARAMETERS</h4>
vec2field <span class="faded">{vec2field}</span> - A vector field to draw<br>
scl <span class="faded">{number} (default = 1)</span> - The scale of the drawn vector field<br>
rgba <span class="faded">{number[]} (default = [0, 0, 0])</span> - The color of the vector field expressed as RGB values (or RGBA values which includes opacity) in an array<br>
domain <span class="faded">{number[]} (default = [-10, 10])</span> - The domain of the vector field, or the range of x- and y-values where the function is drawn, expressed as an array of the arrays of the lower bounds and upper bounds<br>
domain <span class="faded">{number[][]} (default = [[-10, 10], [-10, 10]])</span> - The domain of the vector field, or the range of x- and y-values where the function is drawn, expressed as an array of the arrays of the lower bounds and upper bounds<br>
origin <span class="faded">{number[]} (default = [canvas.width / 2, canvas.height / 2])</span> - The origin (center) of the drawn vector field on the canvas expressed as a point of the canvas in an array<br>
weight <span class="faded">{number} (default = 5)</span> - The stroke weight or line width of the drawn vector field<br>
res <span class="faded">{number} (default = 25)</span> - The resolution of the vector field (the gap in pixels of when the vector field's vector is computed)<br>
Expand Down Expand Up @@ -2108,10 +2108,10 @@ <h4>RETURNS</h4>
<span class="faded">{string}</span> - A message that tells which function's derivative was drawn, where it was drawn, and which color it was drawn with.
</p>
<h4>EXAMPLE</h4>
<pre class="javascript"><code>// Draws the derivative of the function f(x) = x^2 with a scale of 2 colored green at the top-center of the canvas
<pre class="javascript"><code>// Draws the derivative of the function f(x) = x^2 with a scale of 2 colored green with x-values from -10 to 10.
const ctx = document.getElementById("canvas").getContext("2d");
let f = Chalkboard.real.function("x * x");
Chalkboard.plot.dfdx(f, 2, [0, 255, 0], [canvas.width / 2, canvas.height / 4]);</code></pre>
Chalkboard.plot.dfdx(f, 2, [0, 255, 0], [-10, 10]);</code></pre>
<h3><span class="faded">Chalkboard.plot.</span>d2fdx2(func, scl, rgba, domain, origin, weight, res, context)</h3>
<h4>DESCRIPTION</h4>
<p>Draws the <a href="https://en.wikipedia.org/wiki/Second_derivative">second derivative</a> of a Chalkboard function.</p>
Expand All @@ -2128,13 +2128,13 @@ <h4>PARAMETERS</h4>
</p>
<h4>RETURNS</h4>
<p>
<span class="faded">{string}</span> - A message that tells which function's derivative was drawn, where it was drawn, and which color it was drawn with.
<span class="faded">{string}</span> - A message that tells which function's second derivative was drawn, where it was drawn, and which color it was drawn with.
</p>
<h4>EXAMPLE</h4>
<pre class="javascript"><code>// Draws the derivative of the function f(x) = x^2 with a scale of 2 colored green at the top-center of the canvas
<pre class="javascript"><code>// Draws the second derivative of the function f(x) = x^2 with a scale of 2 colored green with x-values from -10 to 10.
const ctx = document.getElementById("canvas").getContext("2d");
let f = Chalkboard.real.function("x * x");
Chalkboard.plot.dfdx(f, 2, [0, 255, 0], [canvas.width / 2, canvas.height / 4]);</code></pre>
Chalkboard.plot.d2fdx2(f, 2, [0, 255, 0], [-10, 10]);</code></pre>
<h3><span class="faded">Chalkboard.plot.</span>fxdx(func, scl, rgba, domain, origin, weight, res, context)</h3>
<h4>DESCRIPTION</h4>
<p>Draws the <a href="https://en.wikipedia.org/wiki/Antiderivative">antiderivative</a> of a Chalkboard function.</p>
Expand All @@ -2154,10 +2154,10 @@ <h4>RETURNS</h4>
<span class="faded">{string}</span> - A message that tells which function's antiderivative was drawn, where it was drawn, and which color it was drawn with.
</p>
<h4>EXAMPLE</h4>
<pre class="javascript"><code>// Draws the antiderivative of the function f(x) = x^2 with a scale of 2 colored blue at the bottom-center of the canvas
<pre class="javascript"><code>// Draws the antiderivative of the function f(x) = x^2 with a scale of 2 colored blue with x-values from -10 to 10
const ctx = document.getElementById("canvas").getContext("2d");
let f = Chalkboard.real.function("x * x");
Chalkboard.plot.fxdx(f, 2, [0, 0, 255], [canvas.width / 2, 3 * canvas.height / 4]);</code></pre>
Chalkboard.plot.fxdx(f, 2, [0, 0, 255], [-10, 10]);</code></pre>
<h3><span class="faded">Chalkboard.plot.</span>convolution(func_1, func_2, scl, rgba, domain, origin, weight, res, context)</h3>
<h4>DESCRIPTION</h4>
<p>Draws the <a href="https://en.wikipedia.org/wiki/Convolution">convolution</a> of two Chalkboard functions.</p>
Expand Down Expand Up @@ -6435,4 +6435,4 @@ <h4>EXAMPLE</h4>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
<script type="text/javascript" src="script.js"></script>
</body>
</html>
</html>