Witam!
Mam problem z narysowanie wykresu funkcji sinus:
void drawChart() {
Graphics^ grafika=this->pictureBox1->CreateGraphics();
Pen^ pioro=gcnew Pen(System::Drawing::Color::Black);
//int pocz_x=5,pocz_y=10,kon_x=200,kon_y=300;
//grafika->DrawLine(pioro,pocz_x,pocz_y,kon_x,kon_y);
// grafika->DrawEllipse(Pens::Red, 30, 20, 20, 30);
array<System::Drawing::PointF>^ punkty = gcnew array <System::Drawing::PointF>(40);
for(int i = 0; i < 40; i++) {
punkty[i].X = System::Convert::ToSingle(i*10);
punkty[i].Y = System::Convert::ToSingle(Math::Sin(i)*10);
}
grafika->DrawCurve(pioro,punkty);
//drawSin();
}
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
drawChart();
}
Fragment kodu który rysuje funkcje. Problem w tym, że wyświetlone są jakby tylko ujemne wartości funkcji a to co powyżej y = 0 nie jest wyświetlone.
Proszę o pomoc.