1 Star 1 Fork 0

wamwamja/math-game

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
heart2d.c 595 Bytes
Copy Edit 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;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/CharlieLUO/math-game.git
git@gitee.com:CharlieLUO/math-game.git
CharlieLUO
math-game
math-game
master

Search

344bd9b3 5694891 D2dac590 5694891