c语言玫瑰告白代码

作为资深趣味寻找者,这次有一个好程序分享。

#include

#include

#include

#include

#include

#pragma comment(lib,"winmm.lib")

//定义全局变量

int rosesize = 500;

int h = -250;

//定义结构体

struct DOT

{

double x;

double y;

double z;

double r;

double g;

};

bool calc(double a,double b,double c,DOT &d)

{

double j, n, o, w, z;

//花柄

if (c > 60)

{

d.x = sin(a * 7)*(13 + 5 / (0.2 + pow(b * 4, 4))) - sin(b) * 50;

d.y = b*rosesize + 50;

d.z = 625 + cos(a * 7)*(13 + 5 / (0.2 + pow(b * 4, 4))) + b * 400;

d.r = a * 1 - b / 2;

d.g = a;

return true;

}

double A = a * 2 - 1;

double B = b * 2 - 1;

if (A*A + B*B < 1)

{

//绿叶

if (c > 37)

{

j = (int(c) & 1);

n = j ? 6 : 4;

o = 0.5 / (a + 0.01) + cos(b * 125) * 3 - a * 300;

w = b * h;

d.x = o * cos(n) + w * sin(n) + j * 610 - 390;

d.y = o * sin(n) - w * cos(n) + 550 - j * 350;

d.z = 1180 + cos(B + A) * 99 - j * 300;

d.r = 0.4 - a * 0.1 + pow(1 - B * B, -h * 6) * 0.15 - a * b * 0.4 + cos(a + b) / 5 +

pow(cos((o * (a + 1) + (B > 0 ? w : -w)) / 25), 30) * 0.1 * (1 - B * B);

d.g = o / 1000 + 0.7 - o * w * 0.000003;

return true;

}

 

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 博客之星2020 设计师:CY__ 返回首页