Click here to Skip to main content
15,887,175 members
Home / Discussions / C#
   

C#

 
QuestionCreating Entity Class for XML Pin
K V Sekhar16-Feb-10 18:56
K V Sekhar16-Feb-10 18:56 
AnswerRe: Creating Entity Class for XML Pin
Saksida Bojan16-Feb-10 20:47
Saksida Bojan16-Feb-10 20:47 
GeneralRe: Creating Entity Class for XML Pin
kfqnwang9-Mar-11 16:00
kfqnwang9-Mar-11 16:00 
QuestionChat Server/Client Pin
satsumatable16-Feb-10 18:09
satsumatable16-Feb-10 18:09 
AnswerRe: Chat Server/Client Pin
Marcel Gheorghita16-Feb-10 19:05
Marcel Gheorghita16-Feb-10 19:05 
Questionmaths Pin
antrock10116-Feb-10 18:06
antrock10116-Feb-10 18:06 
AnswerRe: maths Pin
V.16-Feb-10 21:19
professionalV.16-Feb-10 21:19 
AnswerRe: maths Pin
harold aptroot16-Feb-10 23:29
harold aptroot16-Feb-10 23:29 
Don't use Math.Pow(x, 2), but I don't think that's the problem here.
The problem also isn't the precedence or associativity, (A/B)*C (original formula) equals (C * A)/B (which is what precedence and associativity resolves your code to)
There doesn't appear to be any problem.. but see below.

Suggested replacement: ((velocity * velocity) / gravity) * Math.Sin(angle * 2)

Reasoning: For people reading your code (including yourself) it's easier to see that this code really calculates that formula. Also, Pow(x, 2) equals x*x (mathematically speaking), but Math.Pow is both inefficient and inaccurate, and gives surprising results in some cases (as documented here[^]) most notably raising a negative number to a non-integral power (not the case here). Math.Pow is something I would avoid unless I really had no choice.
AnswerRe: maths Pin
OriginalGriff16-Feb-10 23:56
mveOriginalGriff16-Feb-10 23:56 
GeneralRe: maths Pin
antrock10117-Feb-10 3:59
antrock10117-Feb-10 3:59 
GeneralRe: maths Pin
antrock10117-Feb-10 4:13
antrock10117-Feb-10 4:13 
GeneralRe: maths Pin
antrock10117-Feb-10 11:30
antrock10117-Feb-10 11:30 
GeneralRe: maths Pin
antrock10119-Feb-10 17:42
antrock10119-Feb-10 17:42 
Questionw Pin
bahar316-Feb-10 17:50
bahar316-Feb-10 17:50 
Answerxyz Pin
Dan Mos16-Feb-10 18:38
Dan Mos16-Feb-10 18:38 
AnswerRe: w Pin
Keith Barrow17-Feb-10 2:38
professionalKeith Barrow17-Feb-10 2:38 
QuestionTranslating VB to C# - Mail Script Pin
Antal Dominik16-Feb-10 10:33
Antal Dominik16-Feb-10 10:33 
AnswerRe: Translating VB to C# - Mail Script Pin
AspDotNetDev16-Feb-10 11:46
protectorAspDotNetDev16-Feb-10 11:46 
AnswerRe: Translating VB to C# - Mail Script Pin
Dave Doknjas16-Feb-10 14:17
Dave Doknjas16-Feb-10 14:17 
QuestionDealing with Controls/ Copy it to a new tabControl Pin
Sueberl16-Feb-10 9:54
Sueberl16-Feb-10 9:54 
AnswerRe: Dealing with Controls/ Copy it to a new tabControl Pin
Luc Pattyn16-Feb-10 10:22
sitebuilderLuc Pattyn16-Feb-10 10:22 
GeneralRe: Dealing with Controls/ Copy it to a new tabControl Pin
Sueberl16-Feb-10 10:33
Sueberl16-Feb-10 10:33 
GeneralRe: Dealing with Controls/ Copy it to a new tabControl Pin
hammerstein0516-Feb-10 11:32
hammerstein0516-Feb-10 11:32 
GeneralRe: Dealing with Controls/ Copy it to a new tabControl Pin
Luc Pattyn16-Feb-10 13:53
sitebuilderLuc Pattyn16-Feb-10 13:53 
GeneralRe: Dealing with Controls/ Copy it to a new tabControl Pin
Sueberl17-Feb-10 1:00
Sueberl17-Feb-10 1:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.