adjustments
This commit is contained in:
parent
62c0bf5182
commit
e1c4fa8dc5
|
|
@ -47,11 +47,9 @@ int main(void)
|
|||
for (int i = 0; i < wavePoints; i++)
|
||||
{
|
||||
float t = i/(float)(wavePoints - 1);
|
||||
float angleDeg = t*360.0f;
|
||||
float s = sinf(angleDeg*DEG2RAD);
|
||||
float c = cosf(angleDeg*DEG2RAD);
|
||||
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) };
|
||||
float currentAngle = t*360.0f*DEG2RAD;
|
||||
sinePoints[i] = (Vector2){ start.x + t*start.width, start.y + start.height/2.0f - sinf(currentAngle)*(start.height/2.0f) };
|
||||
cosPoints[i] = (Vector2){ start.x + t*start.width, start.y + start.height/2.0f - cosf(currentAngle)*(start.height/2.0f) };
|
||||
}
|
||||
|
||||
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 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 cotangentPoint = { center.x + cotangent*radius, center.y - radius };
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user