Tengo un triángulo con Coordenadas $\{(x_1,y_1),(x_2,y_2),(x_3,y_3)\}$ . Necesito encontrar las coordenadas de un triángulo, cuyas aristas son exactamente $\alpha$ distancia del triángulo anterior. A continuación se muestra la figura que ilustra este escenario.
SOLUCIÓN:
public void enlargetriangle(Graphics g)
{
double ratiodistance=d; // distance between two triangles
Point xy1; //Point p1
Point xy2; //Point p2
Point xy3; //Point p3
double d1=Math.sqrt(Math.pow((xy2.x-xy3.x), 2)+Math.pow((xy2.y-xy3.y), 2));
double d2=Math.sqrt(Math.pow((xy3.x-xy1.x), 2)+Math.pow((xy3.y-xy1.y), 2));
double d3=Math.sqrt(Math.pow((xy1.x-xy2.x), 2)+Math.pow((xy1.y-xy2.y), 2));
double incenter_X=((((d1*xy1.x)+(d2*xy2.x)+(d3*xy3.x))/(d1+d2+d3)));
double incenter_Y=((((d1*xy1.y)+(d2*xy2.y)+(d3*xy3.y))/(d1+d2+d3)));
Point incenter= new Point((int)((((d1*xy1.x)+(d2*xy2.x)+(d3*xy3.x))/(d1+d2+d3))),(int)(((d1*xy1.y)+(d2*xy2.y)+(d3*xy3.y))/(d1+d2+d3)));
double inradius=Math.sqrt(((-d1+d2+d3)*(d1-d2+d3)*(d1+d2-d3))/(d1+d2+d3))/2;
double ratio_distance=(inradius+ratiodistance)/inradius;
Point xy1_2=new Point((int)(incenter_X+((ratio_distance)*(xy1.x-incenter_X))),(int)(incenter_Y+((ratio_distance)*(xy1.y-incenter_Y))));
Point xy2_2=new Point((int)(incenter_X+((ratio_distance)*(xy2.x-incenter_X))),(int)(incenter_Y+((ratio_distance)*(xy2.y-incenter_Y))));
Point xy3_2=new Point((int)(incenter_X+((ratio_distance)*(xy3.x-incenter_X))),(int)(incenter_Y+((ratio_distance)*(xy3.y-incenter_Y))));
// xy1_1, xy1_2,xy1_3 are the required triangle co-ordinates
}