Questions tagged [math]
Math involves the manipulation of numbers within a program. For general math questions, please ask on math.stackexchange.com. Note: If your question is about unexpected results in floating point calculations, please read https://stackoverflow.com/questions/588004/is-floating-point-math-broken first.
44,372
questions
0
votes
0
answers
8
views
Find semi-equivalent Euler rotation vectors with one axis zeroed out
I’ve been stumped by a 3d math problem that exploits my weakness in quaternions! I am visualizing data from a physical sensor in unity / c#.
I have a ‘rod’ object with a rotation represented by the ...
0
votes
1
answer
22
views
Other angle side(?)
I wrote a method that mirrors the player using scale.
void Flip()
{
Vector3 theScale = transform.localScale;
theScale.x *= -1;
transform.localScale = theScale;
}
Then I ...
-2
votes
0
answers
14
views
Point not rotating around centre correctly [duplicate]
When trying to make a vehicle simulation, the hitch point for the trailer needs to be rotated with the tractor, however it does not seem to be working and the hitch point is too far away from the ...
0
votes
1
answer
47
views
Calculating angle between 3 points give weird result according pattern angle
I want to calculate the angle between two segments in 2D space. The two segments are defined by AB and BC.
The result of the calculation seems to vary according to the orientation of the vectors.
...
2
votes
2
answers
62
views
2D smooth movement from scratch (javascript, pixelart)
My interest in game development led me to the idea of implementing the logic from scratch, without an engine.
Finally, I came to the point of optimizing the movement sequences of the background in an ...
0
votes
0
answers
22
views
How to link invoces and payments in several scenarios
I have a hard problem and I cannot fully solve it using PHP and/or Mysql.I have two arrays payments and invoices per user.
Some assumptions are:
Payment and invoice totals match, for each user
...
-6
votes
2
answers
93
views
math execution order in c [closed]
int a=17,b=3,r=1;
r = a - a / b * 4 % 3 + r;
in which order a C program will execute this:
A) / * % + - =
B) / * % - + =
Can you guys give me a solid explanation of the order in which a C program ...
-1
votes
1
answer
40
views
Create TimeLine field with PyQt5
I need to develop a program to enter time reports. What I do is very similar to time graphics.
I was only able to implement scaling, shuffling and pseudo-infinity fields. The main task is to somehow ...
2
votes
1
answer
41
views
What is the problem with my R code for solving and plotting a coupled system of ODE's?
I'm reasonably new to R and have this system of ODEs
\frac{dS}{dT} = -\beta(1-\mu)S(t)\frac{I(t))}{1-D(t))}
\frac{dI}{dT} = -\beta(1-\mu)S(t)\frac{I(t))}{1-D(t))}-\delta I(t))-\phi I(t))
\frac{dR}{dT}=...
-4
votes
0
answers
67
views
How to do the equivalent of floating point operations? [closed]
Im trying to make a Class which holds a .mantissa and .exponent
with these i can easily store numbers such as 1e1000 or even 1e(1e1000) (thats 1 with a 1e1000 zeros.)
the operations concerning these ...
1
vote
1
answer
83
views
Incorrect calculation of a math expression using sin and cos in C?
Why does this simple program
#include <stdio.h>
#include <math.h>
int main()
{
int res = (int)(-1 * sin(M_PI/2) + 1 * cos(M_PI/2));
printf("-1 * %f + 1 * %f = %d\n", sin(...
5
votes
3
answers
195
views
Multiplication of huge massive of numbers in python
I'm working on a small python program for myself and I need an algorithm for fast multiplication of a huge array with numbers (over 660 000 numbers, each is 9 digits). The result number is over 4 ...
0
votes
0
answers
55
views
Calculating and assigning Christoffel symbols to variables with python
I like to calculate the Christoffel symbols from a given line element and assign the expressions of each of Christoffel symbols to the variables in a user-defined function.
I am using the Python ...
-4
votes
0
answers
42
views
Hadamard Matrix Alternative Construction [closed]
I've been researching on this topic when I saw this construction in Wikipedia of the Hadamard Matrix:
Alternative Construction of Hadamard Matrixes
From the link: https://en.wikipedia.org/wiki/...
-3
votes
0
answers
29
views
How the expressions column can be aligned to left [closed]
[\begin{array}{|c|c|c|c|}\hline\text{ } & \text{ Polynomial}& \text{ }& \text{Type} \ \hline a &w^3 +15w^2 +9w+30& 3 & \text{Linear polynomial} \ \hline b & 13x^2 -30x+24 &...