Luxor Curves

An example from the online tutorial shows how a bezier curve can be drawn as follows:


            using Luxor
            Drawing(600, 600, "Drawing_04.svg")
            origin()
            setline(.5)
            pt1 = Point(0, -125)
            pt2 = Point(200, 125)
            pt3 = Point(200, -125)

            label.(string.(["O", "control point 1", "control point 2", "control point 3"]),
                :e,
                [O, pt1, pt2, pt3])

            sethue("red")
            map(p -> circle(p, 4, :fill), [O, pt1, pt2, pt3])

            line(O, pt1, :stroke)
            line(pt2, pt3, :stroke)

            sethue("black")
            setline(3)

            # start a path
            move(O)
            curve(pt1, pt2, pt3) #  add to current path
            strokepath()
            finish()
            preview()
            

The curve() function goes from the current point, uses the two control points given as the first and second parameters and ends at the third one.