Hi,
I'm trying to draw an helix on a qt dialog or widget but it's not working!
here are the parametric equations of an helix in 2d.
x=30*cos(2*pi*t)
y=t;
that's what i have written so far in the paintEvent function
but the curve does not appear;
void MainWindow:aintEvent(QPaintEvent *){
QPainter paint(this);
for(qreal i=0;i<2*M_PI;i=i+0.1){
y=+300*cos(i); // I know that i did not use the same values that i have written above, i don't care about the values as long
QPoint T(y,i); // as i can draw a random helix!
polygon.push_back(T);
}
paint.drawPolygon(polygon);
}
PS: i don't want to use a graph. Actually i'm trying to draw a spring i need it for a project i'm working on
Thanks For your help![]()
Bookmarks