adjustments

This commit is contained in:
Jopestpe 2025-10-10 18:01:24 -03:00 committed by GitHub
parent 62c0bf5182
commit e1c4fa8dc5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -47,11 +47,9 @@ int main(void)
for (int i = 0; i < wavePoints; i++) for (int i = 0; i < wavePoints; i++)
{ {
float t = i/(float)(wavePoints - 1); float t = i/(float)(wavePoints - 1);
float angleDeg = t*360.0f; float currentAngle = t*360.0f*DEG2RAD;
float s = sinf(angleDeg*DEG2RAD); sinePoints[i] = (Vector2){ start.x + t*start.width, start.y + start.height/2.0f - sinf(currentAngle)*(start.height/2.0f) };
float c = cosf(angleDeg*DEG2RAD); cosPoints[i] = (Vector2){ start.x + t*start.width, start.y + start.height/2.0f - cosf(currentAngle)*(start.height/2.0f) };
sinePoints[i] = (Vector2){ start.x + t*start.width, start.y + start.height/2.0f - s*(start.height/2.0f) };
cosPoints[i] = (Vector2){ start.x + t*start.width, start.y + start.height/2.0f - c*(start.height/2.0f) };
} }
SetTargetFPS(60); // Set our game to run at 60 frames-per-second SetTargetFPS(60); // Set our game to run at 60 frames-per-second
@ -75,7 +73,7 @@ int main(void)
float explementary = 360.0f - angle; float explementary = 360.0f - angle;
float tangent = Clamp(tanf(angleRad), -10.0f, 10.0f); float tangent = Clamp(tanf(angleRad), -10.0f, 10.0f);
float cotangent = Clamp(fabs(tangent) < 0.001f ? 0.0f : 1.0f/tangent, -radius, radius); float cotangent = (fabsf(tangent) > 0.001f) ? Clamp(1.0f/tangent, -radius, radius) : 0.0f;
Vector2 tangentPoint = { center.x + radius, center.y - tangent*radius }; Vector2 tangentPoint = { center.x + radius, center.y - tangent*radius };
Vector2 cotangentPoint = { center.x + cotangent*radius, center.y - radius }; Vector2 cotangentPoint = { center.x + cotangent*radius, center.y - radius };