-2

I have two equations:

(x-6)^2 + (y-2)^2 = 6^2
(x-2)^2 + (y-2)^2 = 3^2

I subtracted the 2nd equation from the 1st and got the answer. However, I want to find x and y from the set of equations using any programming language. Can anybody help to get the source code for this?

Rodrigo de Azevedo
  • 1,097
  • 9
  • 17
Crazy Cat
  • 186
  • 3
  • 13
  • If you want to solve mathematical equations symbolically like this, you could use e.g. [Mathematica](https://www.wolfram.com/mathematica/), [Maple](https://www.maplesoft.com/products/Maple/) or [Julia](https://julialang.org/). You could also check out [Wolfram Alpha](http://wolframalpha.com/) which solves these sort of things online. – Andreas Storvik Strauman Sep 07 '18 at 16:08
  • I want the source code for the problem, not answers. – Crazy Cat Sep 07 '18 at 16:12
  • All of them, except from wolfram alpha, are programming languages. I've made an answer for you with source codes in some of these languages. – Andreas Storvik Strauman Sep 07 '18 at 16:37

1 Answers1

0

If you want to solve mathematical equations symbolically like this, there are many programming languages and softwares available:

Here are some "source code" as you requested:

sympy:

import sympy as sp
x=sp.Symbol('x')
y=sp.Symbol('y')
print(sp.solve([(x-6)**2+(y-2)**2-6**2, (x-2)**2+(y-2)**2-3**2], [x, y]))

Mathematica:

FullSimplify[Solve[{(x - 6)^2 + (y - 2)^2 == 6^2, (x - 2)^2 + (y - 2)^2 == 3^2}, {x, y}]]

Mathematica also has it's own SE site here

Just for the sake of examples: here is a wolfram alpha link