Mathematics is the study of quantity, structure, space, and change. Any math questions on this site should be programming related.
2
votes
1answer
35 views
Logical operators in if-else in R
I have the following table (5 columns and 3 rows) called mat :
AC CA RES
1 0
2 2
1 3
0 0
0 1
The operation being performed is mat[1]/mat[1]+mat[2]
I am testing for the following :
...
0
votes
2answers
30 views
how to find nearest latitude and longitude form current place?
I have a dictionary with a collection of n number of latitude, longitude and address. I want to calculate which (latitude and alangitude)point is closest from current user location(latitude ...
0
votes
1answer
26 views
Adding a return variable to a Number in Javascript
I need to add the OptionPricing variable to the 2: 258 which is in the var AccompPricing, in this script. I want to write something like this 2: 258 + (var Price), but it doesn't work like that. The ...
1
vote
1answer
17 views
Android, remove gravity from the accelerometer using the compass
First of all, I suppose the device at rest at the first measure so the acceleration I have is the gravity one, second I won't use a low pass filter.
Android gives me the linear acceleration and the ...
0
votes
1answer
99 views
what mathematical model can I use for this and how to implement it in c++/c#
I want to write a function that gets up to six parameter and an array of input values and map inputs value to output based on the following conditions:
we know min and max of input values.
The ...
0
votes
1answer
43 views
Implementing the Shih-Wu Euclidean distance transform: what is R(p) used for?
I'm attempting to implement the Shih-Wu distance transform algorithm, as described on page 5 of the pdf. It looks fairly simple but I'm hampered by my limited math (or possibly my reading ...
0
votes
0answers
83 views
JavaScript simple calculation
I'm pretty sure I'm being stupid but why isn't this working!?
form.find( '.per_time' ).on( 'change', function() {
var price = parseInt( form.find( '.section-price' ).attr('data-price'), ...
-4
votes
2answers
88 views
Recursion does not seem to stop in a complicated code [closed]
I wrote a program to generate all possible matrices with some conditions.
It takes argument 'r' and 'n', where 'r' is the number of rows or columns in a matrix, and 'n' is the maximum number that the ...
0
votes
3answers
25 views
Polynomial fitting using L1-norm
I have n points (x0,y0),(x1,y1)...(xn,yn). n is small (10-20). I want to fit these points with a low order (3-4) polynomial: P(x)=a0+a1*x+a2*x^2+a3*x^3.
I have accomplished this using least squares ...
0
votes
0answers
17 views
{LESS] multiple gradients with vendor prefixes
I want to create a background-image aka. gradient mixin with these features:
unlimited amount (not finished yet, but kinda works)
adapting vendor prefixes (partially works)
I tried lesshat, but ...
0
votes
0answers
11 views
Clamping the dot product in a Slerp for Quaternion
I'm looking at two different source for the Slerp method of interpolation between two quaternions. They are pretty similar except for one notable difference: one clamps the dot product between 0 and ...
0
votes
4answers
56 views
Strange issue in converting Feet and Inches to Centimeter and Vice Versa
public static double convertFeetandInchesToCentimeter(String feet, String inches) {
double heightInFeet = 0;
double heightInInches = 0;
try {
if (feet != null && ...
0
votes
1answer
47 views
How to get a 3D point in my space with Yaw, Pitch and Roll and len [closed]
i need to calculate a 3d point in my world space when i have roll pitch , yaw , len.
need a function like this return for me a 3dpoint :
Get3DpointFrom_yaw_pitch_roll(yaw,pitch,roll,len)
Thanks !
...
-3
votes
0answers
39 views
3 ants and a triangle [closed]
Was at an interview today and the interviewer asked me a question to analyse my problem solving skills. He asked if there was a triangle with an ant placed at each angle of the triangle what is the ...
1
vote
3answers
34 views
scanning a float, getting seemingly random values
I was given an assignment to create a procedure that scans a float, called getfloat.
for some reason, I am getting random values. If I enter "1" it prints 49.Why does this happen? And also, when i ...