[code]

QPainter painter(this);

QPainterPath path;

path.moveTo(QPointF(B_Point));

path.lineTo(QPointF(D_Point));

painter.drawPath(m_BiscepLoopPath);

[/code]

BD is a straightline. Now I have to modify this line to a curve so that BD length become 100 pixel. Stright line BD length is only 50. so the line has bend startpoint B and endpoint D remains same but it should match the length to be 100.

Please help me how can I do it.? Thanks Sujan

]]>[code]

QPainter painter(this);

QPainterPath path;

path.moveTo(QPointF(B_Point));

path.lineTo(QPointF(D_Point));

painter.drawPath(m_BiscepLoopPath);

[/code]

BD is a straightline. Now I have to modify this line to a curve so that BD length become 100 pixel. Stright line BD length is only 50. so the line has bend startpoint B and endpoint D remains same but it should match the length to be 100.

Please help me how can I do it.? Thanks Sujan

]]>Will "quadTo":http://qt-project.org/doc/qt-5.0/qtgui/qpainterpath.html#quadTo help you? But don't know how to make the curve exactly 100 pixels.

]]>@

QPointF c;

//calculate c

QPainter painter(this);

QPainterPath path;

path.moveTo(QPointF(B_Point));

path.quadTo(c,QPointF(D_Point));

painter.drawPath(path);

@

The hard part is doing the math to "calculate the arc length":http://en.wikipedia.org/wiki/Curve_length and the control point.

See "this":http://stackoverflow.com/questions/15445260/javascript-canvas-curve-with-fixed-length for example. ]]>