private float addMomentDeflection(float moment, float x, float lineLength, ref float angle, float c1, float c3, float EI, float scale)
{
if (scale < 0)
{
c3 = -moment * lineLength / 3f;
angle = -scale * (-moment * x * x / (2f * lineLength) + moment * x + c3) / EI;
return scale * moment * lineLength * (lineLength - x) * (1f - (lineLength - x) * (lineLength - x) / (lineLength * lineLength)) / (6.0f * EI);
}
else
{
angle = scale * (-moment * x * x / (2f * lineLength) + c1) / EI;
return scale * moment * lineLength * x * (1f - x * x / (lineLength * lineLength)) / (6.0f * EI);
}
}