Category : math

I’m trying to evaluate a Taylor polynomial for the natural logarithm, ln(x), centred at a=1 in Python. I’m using the series given on Wikipedia however when I try a simple calculation like ln(2.7) instead of giving me something close to 1 it gives me a gigantic number. Is there something obvious that I’m doing wrong? ..

Read more

Consider you are standing at position ‘A’ and your destination is position ‘B’ (in a straight line). You car’s fuel tank could hold fuel for ‘L’ km/miles. There are ‘n’ gas stations in the way of ‘A’ and ‘B’ including ‘A’ as the first gas station and ‘B’ as last gas station. You will be ..

Read more

I want to know if there is any way to differentiate a whole number from any other output only using maths, eg if you have the number 5 I would like to convert that into the number 0 using equations, however, the number 5.4342 would output the number -1 (What i am trying to do ..

Read more

Was solving the second answer of this link https://math.stackexchange.com/questions/4044245/there-is-a-rectangle-in-3-dimensional-space-if-i-am-only-given-the-x-and-y but getting value error : Math domain error as below i have written my code x1 = 10 y1 = 5 x2 = 11 y2 = 8 x3 = 4 y3 = 6 c1 = ((x1-x2+x3)*(x2-x3)) + ((y1-y2+y3)*(y2-y3)) c2 = -((x3 * (x2-x3))+(y3 * (y2-y3))) * ..

Read more

I have a csv file with few records : If there is 1 line the function counts correctly. But if i add another records (like in the picture) I have an error: How can I avoid it? This is my code: data = pd.read_csv (r’C:UsersKLSAJDoDesktopProjekt.csv’) p = [(data[‘x_start’]), (data[‘y_start’])] q = [(data[‘x_end’]), (data[‘y_end’])] print (math.dist(p, ..

Read more