using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
Graphics mygr;
Pen mypen;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
kor(100);
}
private PointF F(double u,int R)
{
PointF SP = new PointF();
SP.X=(float)(R*Math.Pow(Math.Cos(u),3));
SP.Y = (float)(R *Math.Pow(Math.Sin(u),3));
return (SP);
}
private void kor(int R)
{
int db = 50;
double a = 0;
double b = 2 * Math.PI;
double h = Math.Abs(b - a)/db;
double u = a;
PointF P0, P1;
P0=new PointF();
P1=new PointF();;
P0 = F(u,R);
mygr.TranslateTransform(100, 100);
for (int i = 2; i <= db+1; i++)
{
u = u + h;
P1 = F(u, R);
mygr.DrawLine(mypen,P0,P1);
P0 = P1;
}
}
}
}
רישיון
Public domainPublic domainfalsefalse
ברצוני, בעלי זכויות היוצרים על יצירה זו, לשחרר יצירה זו לנחלת הכלל. זה תקף בכל העולם. יש מדינות שבהן הדבר אינו אפשרי על פי חוק, אם כך: אני מעניק לכל אחד את הזכות להשתמש בעבודה זו לכל מטרה שהיא, ללא תנאים כלשהם, אלא אם כן תנאים כאלה נדרשים על פי חוק.