mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 09:42:55 +08:00
Added missing brackets for formulas
This commit is contained in:
parent
d81be56adf
commit
172cfdf88d
@ -149,7 +149,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
|
|||||||
if (boundingBox.Width >= 640 || boundingBox.Height >= 480)
|
if (boundingBox.Width >= 640 || boundingBox.Height >= 480)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int subpoints = (2f * circularArcProperties.Radius <= 0.1f) ? 2 : Math.Max(2, (int)Math.Ceiling(circularArcProperties.ThetaRange / (2.0 * Math.Acos(1f - 0.1f / circularArcProperties.Radius))));
|
int subpoints = (2f * circularArcProperties.Radius <= 0.1f) ? 2 : Math.Max(2, (int)Math.Ceiling(circularArcProperties.ThetaRange / (2.0 * Math.Acos(1f - (0.1f / circularArcProperties.Radius)))));
|
||||||
|
|
||||||
//ignore cases where subpoints is int.MaxValue, result will be garbage
|
//ignore cases where subpoints is int.MaxValue, result will be garbage
|
||||||
//as well, having this many subpoints will cause an out of memory error, so can't happen during normal useage
|
//as well, having this many subpoints will cause an out of memory error, so can't happen during normal useage
|
||||||
@ -171,7 +171,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
|
|||||||
if (progress == 0.0f || progress >= (subpoints - 2) / (float)(subpoints - 1))
|
if (progress == 0.0f || progress >= (subpoints - 2) / (float)(subpoints - 1))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
double theta = circularArcProperties.ThetaStart + circularArcProperties.Direction * progress * circularArcProperties.ThetaRange;
|
double theta = circularArcProperties.ThetaStart + (circularArcProperties.Direction * progress * circularArcProperties.ThetaRange);
|
||||||
Vector2 vector = new Vector2((float)Math.Cos(theta), (float)Math.Sin(theta)) * circularArcProperties.Radius;
|
Vector2 vector = new Vector2((float)Math.Cos(theta), (float)Math.Sin(theta)) * circularArcProperties.Radius;
|
||||||
|
|
||||||
Assert.True(Precision.AlmostEquals(circularArcProperties.Centre + vector, path.PositionAt(progress), 0.01f),
|
Assert.True(Precision.AlmostEquals(circularArcProperties.Centre + vector, path.PositionAt(progress), 0.01f),
|
||||||
|
Loading…
Reference in New Issue
Block a user