1 Star 0 Fork 0

wamwamja / math-game

Gitee — Enterprise-level DevOps R&D management platform
Join Gitee
Clone or download
heart2d.c 595 Bytes
Copy Edit Web IDE Raw Blame History
wamwamja authored 2017-10-26 22:38 . 新建 heart2d.c
#include <stdio.h>
#include <math.h>
float f(float x, float y, float z);
double fx(double x, double y, double z);
double fy(double x, double y, double z);
double fz(double x, double y, double z);
int main(int argc, char const *argv[])
{
for (float z = 1.5; z > -1.5; z-=0.1)
{
for (float x = -1.5; x < 1.5; x+=0.05)
{
if (f(x,0,z) < 0)
{
putchar('*');
}
else
putchar(' ');
}
putchar('\n');
}
return 0;
}
float f(float x, float y, float z){
float a = x*x + 9.0/4.0*y*y + z*z - 1;
return a*a*a - x*x*z*z*z - 9.0/80.0*y*y*z*z*z;
}

Comment ( 0 )

Sign in for post a comment

C
1
https://gitee.com/CharlieLUO/math-game.git
git@gitee.com:CharlieLUO/math-game.git
CharlieLUO
math-game
math-game
master

Search

181749 a2d7925e 1850385 181749 9f8568a7 1850385