Category "math"

Trying to create point from X,Y, coordinate

I have used a formula to create an X and Y coordinate that I would like to create a point from. They are held in the attribute table, and I don't know how to us

how to get the slope of a linear regression line using c++?

I need to attain the slope of a linear regression similar to the way the Excel function in the below link is implemented: http://office.microsoft.com/en-gb/ex

Correct implementation of SI, SIS, SIR models (python)

I have created some very basic implementations of the mentioned models. However, although graphs seem to look right, the numbers don't add up to a constant. Tha

Fibonacci Numbers - Add odd numbers only - Javascript

So I am trying to develop a formula that will sum all odd Fibonacci numbers up to and including a given number. For example: Given number is 4. Then result sh

Why XOR of all subsets of a list have same frequency?

I have a list of numbers a1, a2, a3, a4, a5, ... and so on. If we find XOR of all subsets then I noticed that frequency of each distinct XOR is the same. Exam

Direct way of computing clockwise angle between 2 vectors

I want to find out the clockwise angle between 2 vectors(2D, 3D). The clasic way with the dot product gives me the inner angle(0-180 degrees) and I need to us

Rotate a 3D- Point around another one

I have a function in my program which rotates a point (x_p, y_p, z_p) around another point (x_m, y_m, z_m) by the angles w_nx and w_ny. The new coordinates are

Get current quarter in year with javascript

How can I get the current quarter we are in with javascript? I am trying to detect what quarter we are currently in, e.g. 2. EDIT And how can I count the numbe

How to find a point where a line intersects an ellipse in 2D (C#)

I need to find a point where a line (its origin is ellipse' center) intersects an ellipse in 2D... I can easily find a point on a circle, because I know an angl

What is the proper way of calculating this flow calculation in Objective C?

I'm attempting to make a iPhone flow rate calculator that uses these 3 formulas. Pressure ratio b b = p2 + 0.1 / p1 + 0.1 The C-value and B-Value are given

Integer division in Python

I'm confused about the following integer math in python: -7/3 = -3 since (-3)*3 = -9 < -7. I understand. 7/-3 = -3 I don't get how this is defined. (-3)*(-

One-to-one integer mapping function

We are using MySQL and developing an application where we'd like the ID sequence not to be publicly visible... the IDs are hardly top secret and there is no sig

Average transformation matrix for a list of transformations

I have multiple estimates for a transformation matrix, from mapping two point clouds to each other via ICP (Iterative Closest Point). How can I generate the av

Line of intersection between two planes

How can I find the line of intersection between two planes? I know the mathematics idea, and I did the cross product between the the planes normal vectors bu

Problem solving differential equations using odeint and sympy

I am trying to solve and display a graph of the following equation: f'=af²-bf Therefore I have tried to use scipy.integrate.odeint library function to so

Algorithm for pow(float, float)

I need an efficent algorithm to do math::power function between two floats, do you have any idea how to do this, (i need the algorithm not to use the function

How to round up value C# to the nearest integer?

I want to round up double to int. Eg, double a=0.4, b=0.5; I want to change them both to integer. so that int aa=0, bb=1; aa is from a and bb is from b

Remove insignificant trailing zeros from a number?

Have I missed a standard API call that removes trailing insignificant zeros from a number? var x = 1.234000; // to become 1.234 var y = 1.234001; // stays 1.234

Draw the midpoint lines between points

I am making generated shapes in a fragment shader and part of it involves drawing the border between objects ie the dividing line between them. Currently I have