Algorithm for solving simultaneous equations [closed] - c++

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
I'm making an mfc application in which I need to deduce if two lines intersect or not. For that I have the 2 equations:
x= [-x1y2 +x2y1 - (x2-x1)y ] / y1-y2
y= [-x3y4 +x4y3 - (y3-y4)x ] / x4-x3
But I need a way to solve these 2 equations simultaneously, How would I do that?

OK, assuming that x1,x2,x3,x4,y1,y2,y3,y4 are constant inside the process we can also write this as
x=a-b*y
y=c-d*x
with a=(-x1y2+x2y1)/y1-y2 etc.
Now substituting the first line into the second gives
y=c-d*(a-b*y)
y(1+d*b)=c-d*a
y=(c-d*a)/(1+d*b)
resubstituting into x=a-b*y gives the x part of the result

Related

C++ input value process as math function [closed]

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 6 years ago.
Improve this question
I’m very new in C++ and I need your help. I want to use the input value as a mathematical function then print the result.
What i need is:
When user input: 2 +1 and hit Enter then output (cout>>)
should be your result is: 3 (the sum of 2 + 1)
The mathematical symbol could be + or * or / or -.
Could you please help me with some example?
Thanks in advance!
Search for "Reverse Polish notation" and implementation in C++

VS2010 - What is this little blue circle at the single-step yellow arrow? [closed]

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 9 years ago.
Improve this question
When this blue circle appears, the execution doesn't follow the normal flow. The program may jump to random position of current function.
That means you're following multithreaded operations. The arrow jumps around to follow each thread's activities as they execute in parallel.

DFA -> RE using State Elimination [closed]

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 9 years ago.
Improve this question
Would anyone be able to explain to me how I would go about converting this DFA to a Regular Expression using the "State Elimination" Method. I have looked online but don't quite understand the few examples I've seen.
Thank you.
First Convert the edges to RE's
Eliminate state 1
Note edge from 3 --> 3
Result = (0+10)*11(0+1)*

different between CRC8 , CRC16 and CRC32? [closed]

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 9 years ago.
Improve this question
I would like to know the difference and how to choose the polynomial generator for different crc ?
And in some C code they have look up table to compute crc and some of them do it by xor truth table. but in both the cases it is 1byte data array. Its confusing . Could somebody explain this as well ?
Thanks.!

How to install a mod for a videogame? [closed]

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 12 years ago.
Improve this question
I have created a mod for Mafia 3 ( the videogame ). So I need to know where is the folder of this game on the pc that not is always the same.
How can I do ?
Have your installer ask the user to specify where the game directory is, pretty common way to solve this problem