Plot a simple heart-shaped function in C#

The example Plot a heart-shaped function in C# shows how to draw a relatively complex heart-shaped function. Recently I saw a much simpler function on a t-shirt at ThinkGeek.com on this page. The function is:

This example is the same as the previous one except it plots the following function.

// The function.
private float HeartFunc(float x, float y)
{
double a = x * x;
double b = y - Math.Pow(x * x, (double)1 / 3);
return (float)(a + b * b - 1);
}

   

 

What did you think of this article?




Trackbacks
  • No trackbacks exist for this post.
Comments
  • No comments exist for this post.
Leave a comment

Submitted comments are subject to moderation before being displayed.

 Name

 Email (will not be published)

 Website

Your comment is 0 characters limited to 3000 characters.