(12C) Pythagorean Triple
|
09-18-2019, 11:37 AM
(This post was last modified: 09-19-2019 12:48 AM by Gamo.)
Post: #1
|
|||
|
|||
(12C) Pythagorean Triple
Program to generate a Pythagorean Triples based on this formula
a = m^2 - n^2 , b = 2mn , c = m^2 + n^2 for m > n with m and n co-prime and not both odd ------------------------------------------------- Procedure: FIX 0 Your choice of integer m > n m [ENTER] n [R/S] display answer a ... b ... c [R/S] add one on both m and n and display next result. To start over with new pair of m and n f [PRGM] ------------------------------------------------- example: f [PRGM] m = 2 , n = 1 2 [ENTER] 1 display 3 .... 4 .... 5 [R/S] 5 ... 12 ... 13 To review result use [R↓] [R↓] [R↓] -------------------------------------------------- Program: Code:
Gamo |
|||
09-20-2019, 04:33 PM
Post: #2
|
|||
|
|||
RE: (12C) Pythagorean Triple
If circle x² + y² = c = m² + n², we know P = (m,n) is on the circle.
We can get rational parametizations of the circle, using this rational point. Let line that pass thru P, y = (x-m)t + n. To get its intersection of the other point, Q, substitute it into circle equation: x² + ((x-m)t + n)² = m² + n² (1+t²) x² + (2nt - 2mt²) x + (-m² - 2mnt + m²t²) = 0 Product of roots, xP xQ = m xQ = (-m² - 2mnt + m²t²) / (1+t²) xQ = (-m - 2nt + mt²) / (1+t²) Thus, rational parametized points on the circle is \(\Large Q = \left( {-m - 2nt + mt² \over 1+t²} , {n - 2mt - nt² \over 1+t²} \right) \) If circle is unit circle, and we pick P=(-1, 0), we get trig substitution form, t=tan(½θ) \(\Large Q = (\cos θ, \sin θ) = \left( {1 - t² \over 1+t²}, {2t \over 1+t²} \right) \) Example, with P=(-5,0), and for positive ts we get Qs: \(\large (0,5), (-3,4), (-4,3), ({-75 \over 17}, {40 \over 17}), ({-60 \over 13}, {25 \over 13}), ({-175 \over 37}, {60 \over 37}), ({-24 \over 5}, {7 \over 5}), ({-63 \over 13}, {16 \over 13}) ... \) ref: "The Irrationals", appendix B, by Julian Havil |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)