1
$\begingroup$

Let say I have the following triangles,

enter image description here

I know the distance which is same. I know all the co-ordinates. How to get inner triangle co-ordinates?

Edit: I was able to solved the issue by getting the mid-points of all lines. From these mid-points I can move d distance, So I can get three points. No I have 3 points and 3 slopes. From this, I can get three new equations. Simultaneously, solving the equation get the 3 points.

  • 0
    I have learnt a lot @GerryMyerson. Thanks for this perfact site. Currently, I am using a method which is not working perfactly. That's why I asked another one.2012-04-12

5 Answers 5

0

I had come across a similar problem when I was doing stuff with THREE.js

For the sake of simplicity assume the triangle is equilateral; one of its vertices is at the origin, and one of its sides is along the $x$-axis; and its side length $p$.

Now the vertices of the above triangle are $A\space(0,0)$, $B\space(p, 0)$, and, $C\space(\frac{p}{2}, \frac{p\sqrt3}{2})$

The procedure goes like this:

I am trying to find a line parallel to $AC$ but at a perpendicular distance $p$

  1. Conside line $AC$. Slope $ = m = \frac{y_2 - y_1}{x_2-x_1} = \sqrt3 \implies \theta = 60^\circ $

    Equation of the line, $y = \sqrt3x$

    A line normal to this would have slope $m = -\frac{1}{\sqrt3}$ or $\theta' = 150^\circ ( = 60^\circ + 90^\circ)$

    $\therefore$ its equation would be $y = -\frac{1}{\sqrt3}x$

    Note: slope form of line is $y = mx + c$. We normally have to compute for $c$, but since our line passes through origin $c = 0$

  2. Assume a circle with center at origin, and radius $d$, i.e. $x^2 + y^2 = d^2$

    Any point of this circle $P_\alpha (d\space cos\space\alpha, d \space sin \space \alpha)$. Its diametrically opposite point $P_\alpha' (d\space cos\space (180^\circ + \alpha), d \space sin \space (180^\circ + \alpha))$

    We find the points for $\theta'$

  3. In order to decide which of the two points to consider, use this formula. We consider the vertex opposite to $AC$, i.e. $B\space (p,0)$. We compute the quantities using points $B, P_{\theta'}$, and $P_{\theta'}'$; select result that has the same sign of $B$'s result.

    Now its easy to get the equation of the line parallel to AC

Repeat this procedure for the other two sides, solve the equations for the intersecting lines, and you get the coordinates of the inner triangle.

And you get a result like: $A'\space(d(1+\frac{1}{\sqrt3}), d)$, $B' \space (p-d\sqrt3, p)$, and, $C' \space (\frac{p}{2}, \frac{p\sqrt3}{2} - d(1-\frac{1}{\sqrt3}))$

1

With your particular numbers, the diagram does not quite work. But I will give a procedure that works if you want the distances to be, say $2$.

The equation of our slanted line is $8x+6y-48=0$. We find for example the coordinates of the rightmost corner of the little triangle. Its $y$-coordinate is $2$. Let the $x$-coordinate be $p$.

The distance from $(p,2)$ to the slanted line is given by $\frac{|8p+6\cdot 2-48|}{\sqrt{8^2+6^2}}.$ Set this equal to $2$. There are two solutions $p$. Discard the one which is outside the big triangle.

  • 0
    See my edited post.2012-04-12
1

Let's denote distance as $d$ .Since inner triangle (see picture below) is similar to the outer triangle it follows :

$6 : 8 = \sqrt{(x_B-d)^2+(d-d)^2} : \sqrt{(y_C-d)^2+(d-d)^2} $

Since inner triangle is right-angled triangle it follows :

$\sqrt{(d-y_C)^2+(x_B-d)^2}=\sqrt{(y_C-d)^2}+\sqrt{(x_B-d)^2}$

So you have a system of two equations in two unknowns .

enter image description here

  • 0
    See my edited post.2012-04-12
1

It seems to me that what many of your problems have in common is a given line $L$ and a given distance $d$ and you want a line $M$ parallel to $L$ and at distance $d$ from $L$, so let's solve this problem once and for all and then maybe you can solve all your problems.

Let the line $L$ be given by $y=mx+b$. Pick any point $P$ on this line, say, $P=(0,b)$. The line through $P$ perpendicular to $L$ has equation $y=-(1/m)x+b$ We want a point $Q$ on this line at distance $d$ from $(0,b)$, so we want $x^2+(y-b)^2=d^2$ So we have two (displayed) equations in the two unknowns $x,y$. The first equation says $y-b=-x/m$, and sticking that in the second equation we get $x^2+(x^2/m^2)=d^2$ which you can solve for $x$, getting $x=\pm dm/\sqrt{m^2+1}$. Then you can use the first displayed equation to get $y$. Note that there are two solutions, one on either side of the line $L$. In practice, you should have no difficulty telling which of the two possibilities for $Q$ is the one you want.

Now that you have the coordinates for $Q$, let's say $Q=(r,s)$, the equation of the line $M$ is simply $y=m(x-r)+s$.

Now you generally want vertices, not lines, but that's easily taken care of; once you have the equations of the lines that form your polygon, you find the vertices by solving pairs of equation of lines simultaneously.

You may have to be a little careful with the formulas if the lines involved are horizontal or vertical, but these are the easy cases where you don't really need to do all the work outlined above anyway.

As an exercise, try to carry out these steps with your triangle-in-a-triangle.

  • 0
    The horizontal and vertical lines are *easy* to deal with. The lines at distance $d$ from the vertical line $x=a$ are the lines $x=a+d$ and $x=a-d$. Similarly for the horizontal lines.2012-04-13
0

From your diagram, the point at right angle of the inner triangle is at (5,5), which is outside the outer triangle. you can draw two triangles using coordinating system. Please check your problem.

  • 0
    See my edited post.2012-04-12