I am trying to write code to compute the Efield on a point P in both the x and y direction, from a charged ring.
double y_eField = (_ke_value * _dq * (Sin_angle) / (Math.Pow(r, r)));
开发者_开发问答Problem I am having is the code seems to follow the equation as given but the result it outputs is not correct at all. Anyone able to help please? I appreciate the help.
This might be more applicable for the Physics Stack Exchange. That said, are you sure you want to raise r to the power of r (as implied by Math.pow(r, r)
)? I suspect maybe you want r squared? If that's the case you could use Math.pow(r, 2)
or simply r*r
.
精彩评论