Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Does anyone know how to reverse this equation when only Y, Z are known? I want to know what X is.
(X + Y) % 62 = Z
(X + Y) % 62 = Z
means that X+Y = 62*n + Z for arbitrary integer n, from that follows
X = 62*n+Z-Y
where n can be any integer value, if you need single solution you can pick arbitrary one or if you have any extra limitations on X value you'll need to find X that satisfies them
X = Z - Y + 62*n
where n is any integer.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 5 years ago.
Improve this question
y=0 and x=0
Both increment by 1 every millisecond, but x=0 whenever it reaches 120.
What is the equation for finding x if y is... 5000?
x = y % 120
% is called modulus
You just use modulus.
(y / 120) + (y % 120) = x
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 6 years ago.
Improve this question
I'm stuck in an exercise where I need to find all the values available to solve the equation
ax + by = c
Range: x >= -32768 , y <= 32767
Input: a,b,c.
Output: Values of x,y that solve the equation, otherwise zero.
I'm trying to create an algorithm which solves this, but no luck at the moment. Any help is highly appreciated.
there's 2 ways to solve this
first one:
iterate all (x) from -32768 to 32768
iterate all (y) from -32768 to 32768
check if a*x + b*y == c
which doesn't make that much sense, for y is dependant on x
a*x + b*y = c
b*y = c-a*x
y =(c-a*x)/b
so this algorithm is a lot faster:
iterate all (x) from -32768 to 32768
calculate y as (c-a*x)/b
check if a*x + b*y == c
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
Please forgive my lack of knowledge, which i think it's one of those basic formula related to Trigonometry.
Let's look at visual example:
I have 5 lines, with their line equation (let's say they have zero offset ok)
how can i calculate the Theta of each line equation make (in Pi)?
also I have seen this:
Are they generated from Theta of line equations? or it's another theory which help to find the theta?
much appreciate your time and effort
For equation
y = k * x
tg(Theta) = k
and
Theta = Arctg(k) //arctangent function
General line equation
A * x + B * y + C = 0
(It is more general than y=ax+b and includes cases of vertical and horizontal lines)
Theta = atan2(A, B)
(function atan2 or ArcTan2 exists in math libraries of many programming languages)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
i'm trying to practice my math for my upcoming exam, and i have an example that i'm trying to work out.
I'm trying to find an angle of exactly 90% (making vector B perpendicular to vector A)
A = (1, 3, 2)
B = (2, x, -2)
I've tried x = 0, x = 0.5, x = 1. I can't seem to get the Dot product to equal 0 (making them perpendicular of course).
Can anyone shed some light on how i can find "x" to make A and B 90 degree between each other?
Thanks!
This really should be on math.stackexchange, but someone else can move it. Just compute the dot product of the vectors:
(1, 3, 2) dot (2, x, -2) = 0
2 + 3x - 4 = 0
x = 2/3
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
how can we calculate the coordinates of a line (Formula used) when the length and angle is given.
I have to make a pop up box which will take as input the length and angle and will draw a line.
just need the formula
Assuming one end of the line is at (x0, y0), the other end will be at:
x1 = x0 + r cos(t * pi / 180)
y1 = y0 + r sin(t * pi / 180)
where r is the length of the line and t is the angle in degrees.