CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

1. Junior Member Join Date
Jun 2014
Posts
21

## Symbolic transformations

Which is method to symbolic transformations of equations?
For example: I must find equation of line passing through two points (x0,y0) and (x1,y) in form Ax + By + C = 0
this equation is (y-y0)*(x1-x0) = (x-x0)*(y1-y0)
algorithm must change it to (y1-y0)x + (x0-x1)y + y0(x1-x0) + x0(y0-y1)  Reply With Quote

2. ## Re: Symbolic transformations

To convert your eqn 1 to eqn 2 is simply a matter of basic algebraic manipulation which can be done on paper in a couple of lines. So the method is just using algebraic manipulation.

Note that your eqn 2 can be further simplified to

Code:
`x(y1 - y0) + y(x0 -x1) + (x1y0 - x0y1) = 0`  Reply With Quote

3. Junior Member Join Date
Jun 2014
Posts
21

## Re: Symbolic transformations

Algebraic programs prefers Lisp. If is possible code it with Java?  Reply With Quote

4. ## Re: Symbolic transformations Originally Posted by Borneq Algebraic programs prefers Lisp. If is possible code it with Java?
Code what?  Reply With Quote

5. Member +  Join Date
Jul 2013
Posts
576

## Re: Symbolic transformations Originally Posted by Borneq Which is method to symbolic transformations of equations?
The method is simple in principle.

You build a tree representing the equations. Then you transform the tree to conform to your wanted representation of the equations.

Usually the transformations are a set of replacement rules. Each such rule consists of a pattern and what that pattern is supposed to be replace by when the pattern is identified in the tree. It's a language really.

The set of rule patterns are let loose on the tree and the tree becomes modified accordingly until no pattern applies anymore. Then the tree has reached it's fully transformed state and if the transformation language was well designed the equations are now in the form you expected.

This is for example how compilers transform expressions in the optimization phase.
Last edited by razzle; July 18th, 2014 at 04:35 PM.  Reply With Quote

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
• 