Original file (SVG file, nominally 512 × 512 pixels, file size: 7 KB)
![]() | This is a file from the Wikimedia Commons. Information from its description page there is shown below. Commons is a freely licensed media file repository. You can help. |
DescriptionCubic graph special points repeated.svg | Graphs showing the relationship between the roots, and turning, stationary and inflection points of a cubic polynomial, and its first and second derivatives by CMG Lee. Thanks to en:user:GalacticShoe for an algorithm to exactly draw a cubic polynomial segment with a cubic Bezier. | |
Source | Own work | |
Author | Cmglee | |
Other versions |
|
#!/usr/bin/env python
import re
def eval_at(x): return a * x ** 3 + b * x ** 2 + c * x + d
def is_integer(x): return abs(x - int(x)) < 1e-5
def print_keyval(dic, re_key):
print('\t'.join(sorted(['%s=%s' % (key, dic[key])
for key in dic if re.search(re_key, key)])))
## http://wolframalpha.com/input?i=expand+%28x-r1%29%28x-r2%29%5E2
## http://wolframalpha.com/input?i=differentiate+(x-r1)(x-r2)(x-r2)
## http://wolframalpha.com/input?i=solve+2r1*r2-2r1*x%2Br2^2-4r2*x%2B3x^2%3D0+for+x
## http://wolframalpha.com/input?i=differentiate+(x-r2)(x-(2r1%2Br2)%2F3)
## http://wolframalpha.com/input?i=solve+2x-2r1%2F3-4r2%2F3%3D0+for+x
## http://wolframalpha.com/input?i=y%3D(x-4)(x-1)^2
## http://www.wolframalpha.com/input?i=factorise+3x^2-12x%2B9
## Cubic bezier control points from left to right, to be populated
pts = [[-1,None], [None,None], [None,None], [5,None]]
n = 4 ## search range = [-n, n]
for r2 in range(n, -1 - n, -1):
for r1 in range(n, r2 , -1):
if r1 * r2 == 0: continue
r_1 = (2 * r1 + r2) / 3.0
r_2 = r2
if is_integer(r_1) and r_1 != 0: r_1 = int(r_1)
else: continue
r__ = (r1 + 2 * r2) / 3.0
if is_integer(r__) and r__ != 0: r__ = int(r__)
else: continue
if len(set([r1, r_1, r__])) < 3: continue
a = 1
b = -2 * r2 - r1
c = r2 * (2 * r1 + r2)
d = -r1 * r2 * r2
p = pts[0][0]
q = pts[3][0]
pts[0][1] = eval_at(p)
pts[3][1] = eval_at(q)
pts[1][0] = (2 * p + q) / 3.0
pts[1][1] = a * p * p * q + b * (p * p + 2 * p * q) / 3.0 + c * (2 * p + q) / 3.0 + d
pts[2][0] = (p + 2 * q) / 3.0
pts[2][1] = a * p * q * q + b * (q * q + 2 * p * q) / 3.0 + c * (p + 2 * q) / 3.0 + d
print_keyval(locals(), r'^(r_*\d?|[abcd]|pts)$')
![]() |
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue |
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 04:21, 4 February 2024 | ![]() | 512 × 512 (7 KB) | Cmglee | Shrink font and simplify labels // Editing SVG source code using c:User:Rillke/SVGedit.js |
04:00, 4 February 2024 | ![]() | 512 × 512 (7 KB) | Cmglee | Align text // Editing SVG source code using c:User:Rillke/SVGedit.js | |
01:43, 4 February 2024 | ![]() | 512 × 512 (6 KB) | Cmglee | Assorted improvements | |
15:47, 3 February 2024 | ![]() | 512 × 512 (6 KB) | Cmglee | Fix missing dots // Editing SVG source code using c:User:Rillke/SVGedit.js | |
15:19, 3 February 2024 | ![]() | 512 × 512 (6 KB) | Cmglee | {{Information |Description=Graphs showing the relationship between the roots, and turning, stationary and inflection points of a cubic polynomial, and its first and second derivatives by CMG Lee. |Source={{own}} |Date= |Author= Cmglee |Permission= |other_versions={{source thumb|cubic_graph_special_points.svg}} }} Category:Cubic functions Category:Differential calculus |
This file contains additional information, probably added from the digital camera or scanner used to create or digitize it.
If the file has been modified from its original state, some details may not fully reflect the modified file.
Short title | cubic graph special points repeated |
---|---|
Image title | Graphs showing the relationship between the roots, and turning, stationary and inflection points of a cubic polynomial, and its first and second derivatives by CMG Lee. |
Width | 100% |
Height | 100% |