# Mirrored Tree Part II

Hi Guys,
I have created a mirrored tree using the following principle:
Create a network of all the nodes in the document, a tree will occupy one layer, soo two trees occupy two layers, when performLayout on our MirroredTree Class is called, it creates two futher layouts (one on each layer) Both of the trees are layed out and moved so that they face one another.
My question is that there can be links between these two trees that are not used in the layout (so not to get the algo to cross tree boundaries). However these links can be congurent and one on top of the other. <-That is the problem. When we use GoLayoutLayeredDigraph any congruent links have a nice kink in them. How can we get the kink into our links.
Our Mirrored Tree is subclassed from GoLayoutLayeredDigraph, as I thought I might be able to force the layout the links that we want to have a kink in.

Hi All,
I took a little time away from this problem and came back to it today and have solved.
Here is a brief overview just incase anyone else wants to know in the future. :)
{
{
//We donâ€™t want to look at the same link, or ones already bent
{
{
//The diffenrece in gradients is < 0.1 i.e they are parralell
//Are the close to each other
{
//The Lines are very close and are nearly paralell so add in a point have the links either side of the central link, going futher out each side

double xdist=0.0;
double ydist=0.0;
double angle;
double theta1;
double theta2;
double offsetAngle;
// angle in degrees
theta2=180.0f - angle - 90.0f;
theta1=180.0f- angle - theta2;
offsetAngle = 90 +theta1;

{
xdist=Math.Sin( offsetAngle * (Math.PI/180)) * 50;
ydist=Math.Cos(offsetAngle * (Math.PI/180)) * 50;
}
else
{
xdist=Math.Sin( -offsetAngle * (Math.PI/180)) * 50;
ydist=Math.Cos(-offsetAngle * (Math.PI/180)) * 50;
}