|
Post by (X) on Apr 18, 2024 15:38:31 GMT 1
I had a dream of a geometry puzzle that I thought might be solvable "in my head".
Now, I am not so sure. Can you think of a solution to this puzzle?
|
|
|
Post by dragonjim on Apr 19, 2024 10:41:58 GMT 1
Sadly, geometry (and mechanics) were not my strong suit at school - how I passed the exam is still a mystery...
However, from what I can still remember from all those years ago, you may want to treat the problem as a mechanics problem:
You have two objects, one travelling in a circular trajectory - (x^2 + y^2) = r^2 assuming the centre of the circle is (0,0) and, because your radius is 1, you can simplify this further to x^2 + y^2 = 1 - and the other travelling along a straight line y = 1 - 2x (the line you have drawn): where will they meet?
So if y = 1 - 2x, then replacing x for y in the circular trajectory would give x^2 + (1 - 2x)^2 = 1 which gives you..
=> x^2 + (1 - 2x - 2x + 4x^2) = 1
=> 5x^2 - 4x + 1 = 1
=> 5x^2 - 4x = 0
=> x(5x - 4) = 0
So, where 5x - 4 = 0, x must be 4/5 or 0.8; put that back into y = 1 - 2x then that gives you y = 1 - 1.6 => y = 0.6
Assuming that what I have done above is correct, the difficult bit will now be translating that into code...
Edit: And from that equation, the other cross over point will be where x = 0, so where y = 1.
|
|
|
Post by (X) on Apr 19, 2024 13:26:55 GMT 1
Sadly, geometry (and mechanics) were not my strong suit at school - how I passed the exam is still a mystery... However, from what I can still remember from all those years ago, you may want to treat the problem as a mechanics problem: You have two objects, one travelling in a circular trajectory - (x^2 + y^2) = r^2 assuming the centre of the circle is (0,0) and, because your radius is 1, you can simplify this further to x^2 + y^2 = 1 - and the other travelling along a straight line y = 1 - 2x (the line you have drawn): where will they meet? So if y = 1 - 2x, then replacing x for y in the circular trajectory would give x^2 + (1 - 2x)^2 = 1 which gives you.. => x^2 + (1 - 2x - 2x + 4x^2) = 1 => 5x^2 - 4x + 1 = 1 => 5x^2 - 4x = 0 => x(5x - 4) = 0 So, where 5x - 4 = 0, x must be 4/5 or 0.8; put that back into y = 1 - 2x then that gives you y = 1 - 1.6 => y = 0.6Assuming that what I have done above is correct, the difficult bit will now be translating that into code... Edit: And from that equation, the other cross over point will be where x = 0, so where y = 1. This is great! A small missing minus sign typo: y = 1 - 1.6 => y = -0.6
|
|
|
Post by (X) on Apr 19, 2024 13:42:21 GMT 1
This equation solver website seems to agree:
This is amazing to me since the graph looks a lot like the one in my example.
|
|
|
Post by (X) on Apr 19, 2024 14:52:58 GMT 1
Here is version 2 of the Graph Puzzle Demo which uses a function that employs the Quadratic formula to return the roots of the equation of the form: ax² + bx + c = 0 Demo Graph Puzzle V2.G32 (4.38 KB)
Function SolveQuadratic(a As Double, b As Double, c As Double) As Bool ' ' For an equation of the form: ' ' ax² + bx + c = 0 ' ' There are 2 possible solutions or roots for x as noted in: root(1) and root(2). ' It is worth noting that we must allow for the possiblility that the discriminant ' may be negative, thus a complex number ' Try Global roots(1 To 2) As Double Dim discriminant As Double ' Calculate the discriminant discriminant = b ^ 2 - 4 * a * c ' Check if the roots are real or complex If discriminant >= 0 Then ' Real roots roots(1) = (-b + Sqr(discriminant)) / (2 * a) roots(2) = (-b - Sqr(discriminant)) / (2 * a) Else ' Complex roots roots(1) = -b / (2 * a) roots(2) = Sqr(-discriminant) / (2 * a) End If Return True Catch Return False EndCatch End Function
|
|
|
Post by dragonjim on Apr 19, 2024 15:13:29 GMT 1
Now you see why it is a miracle I passed the exam...
|
|
|
Post by (X) on Apr 19, 2024 15:14:40 GMT 1
Isn't it surprising that the result should be an exact fractions 0.6 = 3/5 = 6/10 and 0.8 = 4/5 = 8/10 ? I was rather expecting some irrational number like Pi or the Golden ratio to pop-up. An exact number... Huh!
|
|
|
Post by (X) on Apr 23, 2024 21:28:25 GMT 1
This video was a suggested as a link for me to look at when I started Mozilla browser...
A Different Way to Solve Quadratic Equations:
|
|