var myTemp2Y = (myYl - myNewYl) * myTwoThirds;
var myPointDX = myPointZX + myOneThird * (myNewXl -myPointZX);
var myPointDY = myPointZY + myOneThird * (myNewYl -myPointZY);
var myPointEX = myPointZX + myOneThird * (myNewX2 -myPointZX);
var myPointEY = myPointZY + myOneThird * (myNewY2 -myPointZY);
var myPointFX = myPointDX + myTwoThirds * (myXl -myTemplX - myPointDX); var myPointFY = myPointDY + myTwoThirds * (myYl -myTemplY - myPointDY); var myPointGX = myPointEX + myTwoThirds * (myXl - ^ туТешр2Х - myPointEX); var myPointGY = myPointEY + myTwoThirds * (myYl -myTemp2Y - myPointEY); var myPointHX = myPointZX + myTemplX + myTemp2X; var myPointHY = myPointZY + myTemplY + myTemp2Y;
myPoint = [ [myNewX2, myNewY2], [myNewX2, myNewY2], [myNewX2, myNewY2] ]; myPointArray.push(myPoint) ;
myPoint = [ [myPointEX, myPointEY], [myPointEX, myPointEY],[myPointEX, myPointEY]]; myPointArray.push(myPoint);
myPoint = [ [myPointGX, myPointGY], [myPointGX, myPointGY],[myPointGX, myPointGY]]; myPointArray.push(myPoint);
myPoint = [[myPointHX, myPointHY],[myPointHX, myPointHY], [myPointHX, myPointHY]]; myPointArray.push(myPoint);
myPoint = [ [myPointFX, myPointFY], [myPointFX, myPointFY],[myPointFX, myPointFY]] ; myPointArray.push(myPoint);
myPoint = [ [myPointDX, myPointDY], [myPointDX, myPointDY],[myPointDX, myPointDY]]; myPointArray.push(myPoint);
myPoint = [[myNewXl, myNewYl],[myNewXl, myNewYl], [myNewXl, myNewYl]]; myPointArray.push(myPoint); break;
}
)
}
II Самая основная операция - создание кривой по имеющимся
II координатам опорных точек и касательных
myPath.entirePath = myPointArray;
}
}
//
function myAddPoints(myXl, myYl, myX2, myY2, myX3, myY3, myOffset){ var myXAdjust, myYAdjust, myNewXl, myNewYl, myNewX2, myNewY2, myHypotenus e;
myHypotenuse = Math.sqrt(Math.pow((myXl - myX2),2) + 'b Math.pow((myYl - myY2),2)); if (myYl != myY2) {
// Коэффициенты, учитывающие пропорции сторон фигуры myXAdjust = ((myXl - myX2) / myHypotenuse) * myOffset;
myYAdjust = ((myYl - myY2) / myHypotenuse) * myOffset;
myNewXl = myXl - myXAdjust; myNewYl = myYl - myYAdjust;
}
else {
myXAdjust = myOffset;
myYAdjust = 0;
if (myXl < myX2) {
myNewXl = myXl + myXAdjust; myNewYl = myYl + myYAdjust;
}
else {
myNewXl = myXl - myXAdjust; myNewYl = myYl - myYAdjust;
}
myHypotenuse = Math.sqrt(Math.pow((myXl - myX3),2) + 'b Math.pow((myYl - myY3),2)); if (myYl != myY3) [ myXAdjust = ((myXl - myX3) / myHypotenuse) * myOffset;
myYAdjust = ((myYl - myY3) / myHypotenuse) * myOffset;