You can just compute the sine directly : for(int i = 0; i < width; i++) { int x = i; int y = height / 2 + amplitude * std::sin(2 * M_PI * freq * i / width + phase); path.lineTo(x, y); }
------- Jean-Michaël Celerier http://www.jcelerier.name On Thu, Jul 20, 2017 at 9:47 AM, Patrick Stinson <patrickk...@gmail.com> wrote: > Hello! I want to figure out how to draw a sin wave between two QPointF’s > using QPainterPath. Calculating the cubic control points seems like the > best way, but I am far from mastering that theory. > > This is a diagramming app and the goal is to get a squiggly line between > two objects. > > Thanks! > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest > >
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest