Example #1
0
File: art.go Project: taysom/va
func testSpline(d *doodle.Doodle) {
	list := listA
	if false {
		d.Plot(quad, -2, 5)
		d.Plot(func(x float64) float64 {
			return doodle.Poly(doodle.Vector{1, 0, -5, 0, 4}, x)
		}, -2, 5)
		d.Plot(cubic, -2, 3)
		d.Draw(line, 1.4, 3)
		d.Plot(line, 1.4, 3)
		for z := 0.0; z < 2; z += 0.1 {
			d.Line(doodle.Pt(-1, -2), doodle.Pt(4, 4+z))
		}
		d.GraphLine(list)
		d.GraphPoly(list)
		d.GraphQuadSpline(list)
		d.GraphCubicSplineA(list)
		d.GraphCubicSplineB(list)
		d.GraphCubicSplineC(list)
	}
	bug.Where()
	d.GraphLine(list)
	d.GraphCubicSplineC(list)
}
Example #2
0
File: art.go Project: taysom/va
func quartic(x float64) float64 {
	return doodle.Poly(doodle.Vector{1, 0, -5, 0, 4}, x)
}