Making a logo with processing, can't figure out a coordinate…

I'm struggling to make a simple logo, I have no deep knowledge of Inkscape so I'm doing it with a little bit of processing.

The problem is I can't figure out how to determine one certain point's coordinate, considering I want this point to have certain "constraints" in my geometry construct.

Here is the construct:

Knowing AB (=AD), AC = 1, A = (0,0), C's coordinates are easily determined.

I'm having a hard time figuring out D's coordinates.

I tried CaRMetal, it figures it out, but I can't make a logo with it.

Is it solvable, or should I determine other lenghts instead of this ?

-
Why don't you use GeoGebra? – Sigur Aug 26 '12 at 14:42
zonas.free.fr/processing I don't know if geogebra could do something like this, or maybe close. – jokoon Aug 26 '12 at 18:51

1 Answer

Unless you know the radius of the inner circle, there are infinitely many points which $D$ could be. Once you know the radius of the inner circle you will be able to find two possible points for $D$.

Supposing you know the length of $\overline{AB}$ (or equivalently, $\overline{AD}$). Then, using vector notation, you know what $\mathbf D \cdot \mathbf D$ is. Now $\mathbf D$ and $\mathbf {D-C}$ are perpendicular, so $\mathbf D\cdot (\mathbf D - \mathbf C)=0\implies \mathbf D\cdot \mathbf D=\mathbf D\cdot\mathbf C$ so if we write $\mathbf D=(x,y)$, $\mathbf C=(c_1,c_2)$ and $\overline{AD}=k$ then the points of $\mathbf D$ are given by the intersection of a line and a circle:

$$x^2+y^2=k^2=xc_1+yc_2$$

This will have two points of intersection (unless $k=0$ or the line is tangent to the circle). Obviously if $k=0$ then $\mathbf D$ is at the origin as well. Now if $k\ne0$ and $c_1\ne0$, we can solve the linear equation as follows:

$$x=-\frac {c_2}{c_1} y+\frac {k^2} {c_1}$$

Now you can substitute this in the quadratic equation:

$$\left(-\frac{c_2}{c_1} y+\frac {k^2}{c_2}\right)^2+y^2=k^2$$ Simplifying this will yield a quadratic equation for $y$ without $x$, so you may use the quadratic formula to solve for $y$. This is where you will get two values for $y$, which you can then plug back in to the earlier linear equation to solve for $x$.

If $c_1=0$, the linear equation would already give a specific value for $y$, so you would just substitute that value into the quadratic equation to find two values for $x$.

-
Yes as I said, I know AB (is equal to AD), as in length, I might not have used the correct notation. – jokoon Aug 26 '12 at 18:09
The angle where C is, is known, thinking about the trigonometrical circle. Its angle is 4 * pi / 3 – jokoon Aug 26 '12 at 18:19
by $\mathbf D \cdot \mathbf D$ do you mean $\vec D \cdot \vec D$ ? – jokoon Aug 26 '12 at 18:27
@jokoon Yes, bold fonts are often used to indicate vectors as well – process91 Aug 26 '12 at 18:48
so you end up with $x^2+y^2=xc_1+yc_2=0$, then I can regroup x and y, but what else ? – jokoon Aug 26 '12 at 19:10