# Calculate distance between two points?

Posted 3 years ago
5278 Views
|
4 Replies
|
1 Total Likes
|
 Hi there,I wrote a code and used the function possibility in order to make the code more lean, however it seems that the function functionality makes the thing not work.I computed the same equation in Excel and get the same answer as the final result of the Mathematica codeHelp would be much appreciated. Not sure what I do wrong within the programming now. I somewhat assume the use of Degree inside the function might cause some trouble, but help is appreciated as mentioned before. Ah and just realised, the screenshot doesn't include the definition of rroller and wgap in Mathematica, but they are as such: wgap = 0.0005 ;(gap width in meters) rroller = 0.1; (roller radius in meters)Cheers, Eric
4 Replies
Sort By:
Posted 3 years ago
 Eric,Mathematica uses radians, not degrees. You can either convert to radians (2 Pi/360). You can also use units but to do that you should use Quantity[40, degrees] (I am not in front of my machine so I believe degrees is lowercase and plural but I could be wrong - look it up)Regards,Neil
Posted 3 years ago
 Hi Neil,thanks for your response. With the capital letter Degree behind the number it should work fine as it converts the input of degree into radian automatically, as indicated with my tests of every step along the computation. I didn't know that I can incorporate units with Quantify so far. Thank you very much for that.It should work though, that's the confusing part for me, but if it won't work I'll have to separate the part and just feed the value in radians. I'll see.Thanks, Eric