Commit 33ac4c6e authored by Anna.Pavlova's avatar Anna.Pavlova Committed by Alexander.Trofimov

Сделала базовый класс для CMathMatrix и CEqArray

Перенесла файлы с тестовыми функциями в отдельную папку

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58700 954022d7-b5bf-4e40-9824-e11837661b57
parent 6dd2342c
function CMathPosition()
{
this.x = 0;
this.y = 0;
}
function C_CAccent2(val)
{
this.typeTest = val;
this.Content = new Array();
this.Run = null;
this.Test_ParaRun = null;
this.TestRun = new Array();
this.A = null;
this.X = null;
this.operator = new CTestMathText(true);
this.init();
}
C_CAccent2.prototype.init = function()
{
var A = new CTestMathText(false);
//A.addTxt("a");
var X = new CTestMathText(false);
//X.addTxt("x");
this.A = A;
this.X = X;
this.TestRun = new CTestRun();
this.TestRun.Content.push(this.A);
this.TestRun.Content.push(this.X);
}
C_CAccent2.prototype.setPosition = function(pos)
{
var PosOper = new CMathPosition();
PosOper.x = pos.x;
PosOper.y = pos.y;
this.operator.setPosition(PosOper);
var PosBase = new CMathPosition();
PosBase.x = pos.x;
PosBase.y = pos.y;
this.TestRun.setPosition(PosBase);
}
C_CAccent2.prototype.Resize = function()
{
this.A.size =
{
height: 0,
width: 2.234
};
this.X.size =
{
height: 0,
width: 2.234
};
}
C_CAccent2.prototype.getPosition = function()
{
return this.TestRun.getPosition();
}
function CTestRun()
{
this.Content = new Array();
}
CTestRun.prototype.setPosition = function(pos)
{
var NewPos = new CMathPosition();
NewPos.x = pos.x;
NewPos.y = pos.y;
for(var i = 0; i < this.Content.length; i++)
{
this.Content[i].setPosition(NewPos);
NewPos.x += this.Content[i].size.width;
}
}
CTestRun.prototype.getPosition = function()
{
return "Type 4, First position " + this.Content[0].pos.x + " second position " + this.Content[1].pos.x;
}
function CTestMathText(bJDraw)
{
this.pos = new CMathPosition();
this.bJDraw = bJDraw;
this.GapLeft = 0;
this.rasterOffsetX = 0;
this.rasterOffsetY = 0;
}
CTestMathText.prototype.setPosition = function(pos)
{
if (!this.bJDraw) // for text
{
this.pos.x = pos.x + this.GapLeft;
this.pos.y = pos.y;
}
else // for symbol only drawing
{
this.pos.x = pos.x - this.rasterOffsetX;
this.pos.y = pos.y - this.rasterOffsetY;
}
}
/**
* Created with JetBrains WebStorm.
* User: Anna.Pavlova
* Date: 10/7/14
* Time: 5:37 PM
* To change this template use File | Settings | File Templates.
*/
/*
var metricsTxt = g_oTextMeasurer.Measure2Code(letter);
var _width = metricsTxt.Width;
height = g_oTextMeasurer.GetHeight();
*/
// смена хентов
// editor.SetFontRenderingMode(2);
//change FontSize
//editor.put_TextPrFontSize(parseInt("37"));
function TEST_MATH_JUCTIFICATION(mcJc)
{
MATH_MC_JC = mcJc;
editor.WordControl.m_oLogicDocument.Content[0].Content[0].Root.Resize(null, editor.WordControl.m_oLogicDocument.Content[0].Content[0] , g_oTextMeasurer);
var pos = new CMathPosition();
pos.x = 0;
pos.y = 0;
editor.WordControl.m_oLogicDocument.Content[0].Content[0].Root.setPosition(pos);
editor.WordControl.m_oLogicDocument.DrawingDocument.ClearCachePages();
editor.WordControl.m_oLogicDocument.DrawingDocument.FirePaint();
}
function TEST_MATH_EDIT()
{
//MathComposition.test_for_edit();
MathComposition.test_for_edit();
MathComposition.RecalculateComposition(g_oTextMeasurer, MathComposition.DEFAULT_RUN_PRP);
//MathComposition.Draw_2(x, y, )
editor.WordControl.m_oLogicDocument.DrawingDocument.OnRecalculatePage(0, { Width : Page_Width, Height : Page_Height, Margins : {
Left : X_Left_Field,
Right : X_Right_Field,
Top : Y_Top_Field,
Bottom : Y_Bottom_Field
} } );
}
function TEST_COEFF_ITERATORS()
{
// a*36*36 + b*36 + c = 0.728*tPrp.FontSize = 26
// a*14*14 + b*14 + c = 9
// a*72*72 + b*72 + c = 55
//FSize = 0.0006*FSize*FSize + 0.743*FSize - 1.53;
// argSize = -1
//var x1 = 36, x2 = 14, x3 = 72;
//var d1 = 26, d2 = 10, d3 = 54; // если еще подгонять, то можно d3 = 53,52 взять
var x1 = 36, x2 = 14, x3 = 72;
var d1 = 24, d2 = 10, d3 = 47;
// || x1*x1 x1 1 ||
// || x2*x2 x2 1 ||
// || x3*x3 x3 1 ||
var D = x1*x1*x2 + x1*x3*x3 + x2*x2*x3 - x3*x3*x2 - x3*x1*x1 - x2*x2*x1,
Da = d1*x2 + x1*d3 + d2*x3 - d3*x2 - x3*d1 - d2*x1,
Db = x1*x1*d2 + d1*x3*x3 + x2*x2*d3 - x3*x3*d2 - d3*x1*x1 - x2*x2*d1,
Dc = x1*x1*x2*d3 + x1*x3*x3*d2 + x2*x2*x3*d1 - x3*x3*x2*d1 - x3*x1*x1*d2 - x2*x2*x1*d3;
var a = Da/D,
b = Db/D,
c = Dc/D;
console.log("a: " + a + " b: " + b + " c: " + c);
var check1 = a*x1*x1 + b*x1 + c - d1,
check2 = a*x2*x2 + b*x2 + c - d2,
check3 = a*x3*x3 + b*x3 + c - d3;
console.log("check1: " + check1);
console.log("check2: " + check2);
console.log("check3: " + check3);
var aa = Math.round(a*10000)/10000;
var dd1 = d1 - a*x1*x1,
dd2 = d2 - a*x2*x2;
var DD = x1 - x2,
Dbb = dd1 - dd2,
Dcc = x1*dd2 - x2*dd1;
var bb = Dbb/DD,
cc = Dcc/DD;
bb = Math.round(bb*100)/100;
cc = Math.round(cc*100)/100;
console.log("aa: " + aa + " bb: " + bb + " cc: " + cc);
var check11 = aa*x1*x1 + bb*x1 + cc - d1,
check22 = aa*x2*x2 + bb*x2 + cc - d2,
check33 = aa*x3*x3 + bb*x3 + cc - d3;
console.log("check11: " + check11);
console.log("check22: " + check22);
console.log("check33: " + check33);
}
"use strict";
//HTMLPage.js
var C_SIZE = 72;
function coeff()
{
this.hh1 = [];
this.hh2 = [];
}
coeff.prototype.init_2 = function()
{
this.hh1[0] = 1.82;
this.hh2[0] = 2.09;
this.hh1[1] = 1.64;
this.hh2[1] = 1.65;
this.hh1[2] = 1.57;
this.hh2[2] = 1.92;
this.hh1[3] = 1.48;
this.hh2[3] = 2.16;
// (!)
this.hh1[4] = 1;
this.hh2[4] = 1;
//
this.hh1[5] = 2.5;
this.hh2[5] = 2.5;
this.hh1[6] = 2.1;
this.hh2[6] = 2.1;
this.hh1[7] = 1;
this.hh2[7] = 1;
}
coeff.prototype.init_3 = function()
{
this.hh1[0] = 1.75;
this.hh2[0] = 2.55;
this.hh1[1] = 1.62;
this.hh2[1] = 1.96;
this.hh1[2] = 1.97;
this.hh2[2] = 1.94;
this.hh1[3] = 1.53;
this.hh2[3] = 1.0;
this.hh1[4] = 2.04;
this.hh2[4] = 3.17;
this.hh1[5] = 2.0;
this.hh2[5] = 2.58;
this.hh1[6] = 2.3;
this.hh2[6] = 1.9;
this.hh1[7] = 2.3;
this.hh2[7] = 1.9;
// (!)
this.hh1[8] = 1;
this.hh2[8] = 1;
//
this.hh1[9] = 2.5;
this.hh2[9] = 2.5;
this.hh1[10] = 2.1;
this.hh2[10] = 2.1;
this.hh1[11] = 1;
this.hh2[11] = 1;
}
var Coeff2 = new coeff();
Coeff2.init_3();
function SetHeigthBracket_3()
{
var augm = + document.getElementById("augbr").value;
augm = augm/100;
var x = 23,
y = 27;
var X = [],
Y = [];
Y[0] = 26467; X[0] = 18871;
Y[1] = 25967; X[1] = 18871;
Y[2] = 25384; X[2] = 16830;
Y[3] = 24737; X[3] = 15476;
Y[4] = 24091; X[4] = 14122;
Y[5] = 23341; X[5] = 13309;
Y[6] = 22591; X[6] = 12497;
Y[7] = 21778; X[7] = 12164;
Y[8] = 20965; X[8] = 11831;
Y[9] = 20089; X[9] = 11831;
Y[10] = 19214; X[10] = 11831;
Y[11] = 18317; X[11] = 12083;
Y[12] = 17421; X[12] = 12336;
Y[13] = 16441; X[13] = 12652;
Y[14] = 15462; X[14] = 12969;
Y[15] = 14357; X[15] = 13243;
Y[16] = 13253; X[16] = 13518;
Y[17] = 11961; X[17] = 13518;
Y[18] = 9835; X[18] = 13518;
Y[19] = 8292; X[19] = 12621;
Y[20] = 6750; X[20] = 11724;
Y[21] = 5750; X[21] = 10055;
Y[22] = 4750; X[22] = 8386;
Y[23] = 4270; X[23] = 5987;
Y[24] = 3791; X[24] = 3589;
Y[25] = 3791; X[25] = 626;
Y[26] = 3791; X[26] = 0;
Y[27] = 0; X[27] = 0;
Y[28] = 0; X[28] = 1084;
Y[29] = 83; X[29] = 5963;
Y[30] = 1021; X[30] = 9612;
Y[31] = 1959; X[31] = 13261;
Y[32] = 3543; X[32] = 15700;
Y[33] = 5127; X[33] = 18139;
Y[34] = 7232; X[34] = 19369;
Y[35] = 9337; X[35] = 20599;
Y[36] = 11796; X[36] = 20599;
Y[37] = 13338; X[37] = 20599;
Y[38] = 14588; X[38] = 20283;
Y[39] = 15839; X[39] = 19968;
Y[40] = 16860; X[40] = 19610;
Y[41] = 17882; X[41] = 19252;
Y[42] = 18736; X[42] = 18936;
Y[43] = 19590; X[43] = 18621;
Y[44] = 20340; X[44] = 18621;
Y[45] = 21091; X[45] = 18621;
Y[46] = 21820; X[46] = 18995;
Y[47] = 22550; X[47] = 19370;
Y[48] = 23133; X[48] = 20266;
Y[49] = 23717; X[49] = 21162;
Y[50] = 24092; X[50] = 22703;
Y[51] = 24467; X[51] = 24245;
Y[52] = 24551; X[52] = 26578;
Y[53] = 28133; X[53] = 26578;
/*Y[54] = 28216; X[54] = 24245;
Y[55] = 28612; X[55] = 22703;
Y[56] = 29008; X[56] = 21162;
Y[57] = 29612; X[57] = 20266;
Y[58] = 30216; X[58] = 19370;
Y[59] = 30965; X[59] = 18995;
Y[60] = 31714; X[60] = 18621;
Y[61] = 32548; X[61] = 18621;
Y[62] = 33381; X[62] = 18621;
Y[63] = 34276; X[63] = 18936;
Y[64] = 35172; X[64] = 19252;
Y[65] = 36255; X[65] = 19610;
Y[66] = 37338; X[66] = 19968;
Y[67] = 38670; X[67] = 20283;
Y[68] = 40003; X[68] = 20599;
Y[69] = 41669; X[69] = 20599;
Y[70] = 46917; X[70] = 20599;
Y[71] = 49749; X[71] = 15741;
Y[72] = 52581; X[72] = 10883;
Y[73] = 52665; X[73] = 1084;
Y[74] = 52665; X[74] = 0;
Y[75] = 48749; X[75] = 0;
Y[76] = 48749; X[76] = 626;
Y[77] = 48749; X[77] = 3589;
Y[78] = 48311; X[78] = 5987;
Y[79] = 47874; X[79] = 8386;
Y[80] = 46916; X[80] = 10055;
Y[81] = 45959; X[81] = 11724;
Y[82] = 44480; X[82] = 12621;
Y[83] = 43001; X[83] = 13518;
Y[84] = 40877; X[84] = 13518;
Y[85] = 39545; X[85] = 13518;
Y[86] = 38399; X[86] = 13243;
Y[87] = 37254; X[87] = 12969;
Y[88] = 36191; X[88] = 12652;
Y[89] = 35129; X[89] = 12336;
Y[90] = 34171; X[90] = 12083;
Y[91] = 33214; X[91] = 11831;
Y[92] = 32339; X[92] = 11831;
Y[93] = 31464; X[93] = 11831;
Y[94] = 30652; X[94] = 12164;
Y[95] = 29840; X[95] = 12497;
Y[96] = 29090; X[96] = 13309;
Y[97] = 28341; X[97] = 14122;
Y[98] = 27674; X[98] = 15476;
Y[99] = 27008; X[99] = 16830;
Y[100] = 26467; X[100] = 18871;*/
var textScale = C_SIZE/1000, // 1000 pt
alpha = textScale*25.4/96 /64; // коэффициент; используется для того чтобы перевести координаты в миллиметры
// при рисовании используем координаты в миллиметрах, умноженные на 100
// g_dKoef_px_to_mm = 25.4/96
var XX = [],
YY = [];
var hh1 = [],
hh2 = [];
var c1 = [],
c2 = [];
var delta = augm < 7 ? augm : 7;
if(augm < 7)
{
var RX = [];
if(delta < 5.1)
{
hh1[0] = 1.89;
hh2[0] = 2.58;
hh1[1] = 1.55;
hh2[1] = 1.72;
hh1[2] = 1.5;
hh2[2] = 1.64;
hh1[3] = 1.92;
hh2[3] = 1.97;
// (!)
hh1[4] = 1;
hh2[4] = 1;
//
hh1[5] = 2.5;
hh2[5] = 2.5;
hh1[6] = 2.1;
hh2[6] = 2.1;
hh1[7] = 1;
hh2[7] = 1;
var RX1 = 0.033*delta + 0.967,
RX2 = 0.033*delta + 0.967;
for(var i = 0; i < 27; i++)
RX[i] = RX2;
for(var i = 27; i < 54; i++)
RX[i] = RX1;
}
else
{
hh1[0] = 1.74;
hh2[0] = 1.84;
hh1[1] = 1.62;
hh2[1] = 1.67;
hh1[2] = 1.55;
hh2[2] = 1.91;
hh1[3] = 1.92;
hh2[3] = 1.97;
// (!)
hh1[4] = 1;
hh2[4] = 1;
//
hh1[5] = 2.5;
hh2[5] = 2.5;
hh1[6] = 2.1;
hh2[6] = 2.1;
hh1[7] = 1;
hh2[7] = 1;
var RX1 = 0.145*delta + 0.855,
RX2 = 0.17*delta + 0.83;
for(var i = 0; i < 27; i++)
RX[i] = 0.17*delta + 0.83;
for(var i = 27; i < 54; i++)
RX[i] = 0.145*delta + 0.855;
}
RX[1] = (X[52]*RX[52] - (X[52] - X[1]) )/X[1];
RX[0] = RX[1]*X[1]/X[0];
RX[27] = 1;
RX[26] = 1;
for(var i = 0; i < 8; i++ )
RX[26-i] = 1 + i*((RX2+RX1)/2 - 1)/7;
for(var i = 0; i < 4; i++)
{
c1[i] = Y[30 + 2*i] - Y[28 + 2*i];
c2[i] = Y[23 - 2*i] - Y[25 - 2*i];
}
c1[5] = Y[48] - Y[44];
c2[5] = Y[5] - Y[9];
c1[6] = Y[52] - Y[48];
c2[6] = Y[1] - Y[5];
c1[7] = (Y[0] - Y[1])/2 + Y[1] - Y[52];
c2[7] = (Y[0] - Y[1])/2;
c1[4] = Y[44] - Y[36];
c2[4] = Y[9] - Y[17];
var rest1 = 0,
rest2 = 0;
for(var i = 0; i < 8; i++)
{
if(i == 4)
continue;
hh1[i] = (hh1[i] - 1)*(delta - 1) + 1;
hh2[i] = (hh2[i] - 1)*(delta - 1) + 1;
rest1 += hh1[i]*c1[i];
rest2 += hh2[i]*c2[i];
}
var H1 = delta*(Y[52] + c1[7]),
H2 = H1 - (Y[26] - Y[27]) ;
hh1[4] = (H1 - rest1)/c1[4];
hh2[4] = (H2 - rest2)/c2[4];
YY[27] = Y[27];
YY[26] = Y[26];
YY[28] = Y[27];
YY[25] = Y[26];
for(var i = 0; i < 4; i++)
{
for(var j = 1; j < 3; j ++)
{
var t = j + i*2;
YY[28 + t] = YY[27 + t] + (Y[28+t] - Y[27+t])*hh1[i];
YY[25 - t] = YY[26 - t] + (Y[25-t] - Y[26-t])*hh2[i];
}
}
//переопределяем 36 и 17
for(var i = 1; i < 9; i++)
{
YY[36 + i] = YY[35+i] + (Y[36+i] - Y[35+i])*hh1[4];
YY[17 - i] = YY[18-i] + (Y[17-i] - Y[18-i])*hh2[4];
}
for(var i = 0; i < 4; i++)
{
YY[45+i] = YY[44+i] + ( Y[45+i] - Y[44+i])*hh1[5];
YY[8-i] = YY[9-i] + (Y[8-i] -Y[9-i])*hh2[5];
}
for(var i = 0; i < 4; i++)
{
YY[49+i] = YY[48+i] + (Y[49+i] - Y[48+i])*hh1[6];
YY[4-i] = YY[5-i] + (Y[4-i] - Y[5-i] )*hh2[6];
}
YY[53] = YY[52] + 2*c1[7]*hh1[7];
YY[0] = YY[1] + 2*c2[7]*hh2[7];
}
else
{
hh1[0] = 1.75;
hh2[0] = 2.55;
hh1[1] = 2.89;
hh2[1] = 2.53;
hh1[2] = 2.06;
hh2[2] = 2.08;
hh1[3] = 1.53;
hh2[3] = 1.26;
hh1[4] = 2.04;
hh2[4] = 2.7;
hh1[5] = 2.0;
hh2[5] = 2.58;
hh1[6] = 2.3;
hh2[6] = 1.9;
hh1[7] = 2.3;
hh2[7] = 1.9;
// (!)
hh1[8] = 1;
hh2[8] = 1;
//
hh1[9] = 2.5;
hh2[9] = 2.5;
hh1[10] = 2.1;
hh2[10] = 2.1;
hh1[11] = 1;
hh2[11] = 1;
var rest1 = 0,
rest2 = 0;
for(var i=0; i<8; i++)
{
c1[i] = Y[30+i] - Y[29+i];
c2[i] = Y[24-i] - Y[25-i];
}
c1[9] = Y[48] - Y[44];
c2[9] = Y[5] - Y[9];
c1[10] = Y[52] - Y[48];
c2[10] = Y[1] - Y[5];
c1[11] = (Y[0] - Y[1])/2 + Y[1] - Y[52];
c2[11] = (Y[0] - Y[1])/2;
c1[8] = Y[44] - Y[36];
c2[8] = Y[9] - Y[17];
for(var i = 0; i < 12; i++)
{
if(i == 8)
continue;
hh1[i] = (hh1[i] - 1)*(delta - 1) + 1;
hh2[i] = (hh2[i] - 1)*(delta - 1) + 1;
rest1 += hh1[i]*c1[i];
rest2 += hh2[i]*c2[i];
}
var H1 = delta*(Y[52] + c1[11]),
H2 = H1 - (Y[26] - Y[27]) ;
hh1[8] = (H1 - rest1)/c1[8];
hh2[8] = (H2 - rest2)/c2[8];
YY[27] = Y[27];
YY[26] = Y[26];
YY[28] = Y[27];
YY[25] = Y[26];
for(var i = 0; i < 9; i++)
{
YY[28 + i] = YY[27 + i] + (Y[28+i] - Y[27+i])*hh1[i];
YY[25 - i] = YY[26 - i] + (Y[25-i] - Y[26-i])*hh2[i];
}
//переопределяем 36 и 17
for(var i = 1; i < 9; i++)
{
YY[36 + i] = YY[35+i] + (Y[36+i] - Y[35+i])*hh1[8];
YY[17 - i] = YY[18-i] + (Y[17-i] - Y[18-i])*hh2[8];
}
// TODO
// переделать
for(var i = 0; i < 4; i++)
{
YY[45+i] = YY[44+i] + ( Y[45+i] - Y[44+i])*hh1[9];
YY[8-i] = YY[9-i] + (Y[8-i] -Y[9-i])*hh2[9];
}
for(var i = 0; i < 4; i++)
{
YY[49+i] = YY[48+i] + (Y[49+i] - Y[48+i])*hh1[10];
YY[4-i] = YY[5-i] + (Y[4-i] - Y[5-i] )*hh2[10];
}
YY[53] = YY[52] + 2*c1[11]*hh1[11];
YY[0] = YY[1] + 2*c2[11]*hh2[11];
var RX = [];
for(var i = 0; i < 27; i++)
RX[i] = 0.17*delta + 0.83;
for(var i = 27; i < 54; i++)
RX[i] = 0.145*delta + 0.855;
RX[1] = (X[52]*RX[52] - (X[52] - X[1]) )/X[1];
RX[0] = RX[1]*X[1]/X[0];
RX[27] = 1;
RX[26] = 1;
for(var i = 0; i < 7; i++ )
RX[28-i] = 1 + i*(0.145*delta + 0.855 - 1)/8;
var w = X[33]*RX[33],
w2 = X[9]*RX[9] + 0.15*(X[9]*RX[9] - X[19]*RX[19]);
for(var i = 0; i < 11; i++)
{
RX[34+i] = w/X[34+i];
RX[19-i] = w2/X[19-i];
}
var _H1 = augm*(Y[52] + c1[11]),
_H2 = _H1 - (Y[26] - Y[27]);
var w3 = _H1 - (YY[52] + c1[11]),
w4 = _H2 - (YY[1] - YY[26] + c2[11]);
for(var i = 0; i < 10; i++)
{
YY[53 - i] = YY[53 - i] + w3;
YY[i] = YY[i] + w4;
}
}
var shiftX = 48 * textScale * 1000/72;
for(var i = 0; i < 54; i++)
{
XX[i] = (x + shiftX + X[i]*RX[i]*alpha );
YY[i] = (y + YY[i]*alpha );
}
for(var i = 0; i < 50; i++)
XX[54 + i] = XX[51 - i];
for(var i = 0; i < 50; i++)
YY[54 + i] = YY[53] + YY[52] - YY[51-i];
var penW = 1; //px
MathControl.pGraph.p_width(penW*1000);
MathControl.pGraph.b_color1(0,0,0, 255);
MathControl.pGraph._s();
MathControl.pGraph._m(XX[0], YY[0]);
MathControl.pGraph._l(XX[1], YY[1]);
MathControl.pGraph._c(XX[1], YY[1], XX[2], YY[2], XX[3], YY[3] );
MathControl.pGraph._c(XX[3], YY[3], XX[4], YY[4], XX[5], YY[5] );
MathControl.pGraph._c(XX[5], YY[5], XX[6], YY[6], XX[7], YY[7] );
MathControl.pGraph._c(XX[7], YY[7], XX[8], YY[8], XX[9], YY[9] );
MathControl.pGraph._c(XX[9], YY[9], XX[10], YY[10], XX[11], YY[11] );
MathControl.pGraph._c(XX[11], YY[11], XX[12], YY[12], XX[13], YY[13] );
MathControl.pGraph._c(XX[13], YY[13], XX[14], YY[14], XX[15], YY[15] );
MathControl.pGraph._c(XX[15], YY[15], XX[16], YY[16], XX[17], YY[17] );
MathControl.pGraph._c(XX[17], YY[17], XX[18], YY[18], XX[19], YY[19] );
MathControl.pGraph._c(XX[19], YY[19], XX[20], YY[20], XX[21], YY[21] );
MathControl.pGraph._c(XX[21], YY[21], XX[22], YY[22], XX[23], YY[23] );
MathControl.pGraph._c(XX[23], YY[23], XX[24], YY[24], XX[25], YY[25] );
MathControl.pGraph._l(XX[26], YY[26]);
MathControl.pGraph._l(XX[27], YY[27]);
MathControl.pGraph._l(XX[28], YY[28]);
MathControl.pGraph._c(XX[28], YY[28], XX[29], YY[29], XX[30], YY[30] );
MathControl.pGraph._c(XX[30], YY[30], XX[31], YY[31], XX[32], YY[32] );
MathControl.pGraph._c(XX[32], YY[32], XX[33], YY[33], XX[34], YY[34] );
MathControl.pGraph._c(XX[34], YY[34], XX[35], YY[35], XX[36], YY[36] );
MathControl.pGraph._c(XX[36], YY[36], XX[37], YY[37], XX[38], YY[38] );
MathControl.pGraph._c(XX[38], YY[38], XX[39], YY[39], XX[40], YY[40] );
MathControl.pGraph._c(XX[40], YY[40], XX[41], YY[41], XX[42], YY[42] );
MathControl.pGraph._c(XX[42], YY[42], XX[43], YY[43], XX[44], YY[44] );
MathControl.pGraph._c(XX[44], YY[44], XX[45], YY[45], XX[46], YY[46] );
MathControl.pGraph._c(XX[46], YY[46], XX[47], YY[47], XX[48], YY[48] );
MathControl.pGraph._c(XX[48], YY[48], XX[49], YY[49], XX[50], YY[50] );
MathControl.pGraph._c(XX[50], YY[50], XX[51], YY[51], XX[52], YY[52] );
MathControl.pGraph._l(XX[53], YY[53]);
MathControl.pGraph._c(XX[53], YY[53], XX[54], YY[54], XX[55], YY[55] );
MathControl.pGraph._c(XX[55], YY[55], XX[56], YY[56], XX[57], YY[57] );
MathControl.pGraph._c(XX[57], YY[57], XX[58], YY[58], XX[59], YY[59] );
MathControl.pGraph._c(XX[59], YY[59], XX[60], YY[60], XX[61], YY[61] );
MathControl.pGraph._c(XX[61], YY[61], XX[62], YY[62], XX[63], YY[63] );
MathControl.pGraph._c(XX[63], YY[63], XX[64], YY[64], XX[65], YY[65] );
MathControl.pGraph._c(XX[65], YY[65], XX[66], YY[66], XX[67], YY[67] );
MathControl.pGraph._c(XX[67], YY[67], XX[68], YY[68], XX[69], YY[69] );
MathControl.pGraph._c(XX[69], YY[69], XX[70], YY[70], XX[71], YY[71] );
MathControl.pGraph._c(XX[71], YY[71], XX[72], YY[72], XX[73], YY[73] );
MathControl.pGraph._c(XX[73], YY[73], XX[74], YY[74], XX[75], YY[75] );
MathControl.pGraph._c(XX[75], YY[75], XX[76], YY[76], XX[77], YY[77] );
MathControl.pGraph._l(XX[78], YY[78]);
MathControl.pGraph._l(XX[79], YY[79]);
MathControl.pGraph._l(XX[80], YY[80]);
MathControl.pGraph._c(XX[80], YY[80], XX[81], YY[81], XX[82], YY[82] );
MathControl.pGraph._c(XX[82], YY[82], XX[83], YY[83], XX[84], YY[84] );
MathControl.pGraph._c(XX[84], YY[84], XX[85], YY[85], XX[86], YY[86] );
MathControl.pGraph._c(XX[86], YY[86], XX[87], YY[87], XX[88], YY[88] );
MathControl.pGraph._c(XX[88], YY[88], XX[89], YY[89], XX[90], YY[90] );
MathControl.pGraph._c(XX[90], YY[90], XX[91], YY[91], XX[92], YY[92] );
MathControl.pGraph._c(XX[92], YY[92], XX[93], YY[93], XX[94], YY[94] );
MathControl.pGraph._c(XX[94], YY[94], XX[95], YY[95], XX[96], YY[96] );
MathControl.pGraph._c(XX[96], YY[96], XX[97], YY[97], XX[98], YY[98] );
MathControl.pGraph._c(XX[98], YY[98], XX[99], YY[99], XX[100], YY[100] );
MathControl.pGraph._c(XX[100], YY[100], XX[101], YY[101], XX[102], YY[102]);
MathControl.pGraph._c(XX[102], YY[102], XX[103], YY[103], XX[0], YY[0]);
MathControl.pGraph.df();
}
function SetHeigthBracket()
{
var augm = + document.getElementById("augbr").value;
augm = augm/100;
var x = 23,
y = 27;
var X = [],
Y = [];
Y[0] = 26467; X[0] = 18871;
Y[1] = 25967; X[1] = 18871;
Y[2] = 25384; X[2] = 16830;
Y[3] = 24737; X[3] = 15476;
Y[4] = 24091; X[4] = 14122;
Y[5] = 23341; X[5] = 13309;
Y[6] = 22591; X[6] = 12497;
Y[7] = 21778; X[7] = 12164;
Y[8] = 20965; X[8] = 11831;
Y[9] = 20089; X[9] = 11831;
Y[10] = 19214; X[10] = 11831;
Y[11] = 18317; X[11] = 12083;
Y[12] = 17421; X[12] = 12336;
Y[13] = 16441; X[13] = 12652;
Y[14] = 15462; X[14] = 12969;
Y[15] = 14357; X[15] = 13243;
Y[16] = 13253; X[16] = 13518;
Y[17] = 11961; X[17] = 13518;
Y[18] = 9835; X[18] = 13518;
Y[19] = 8292; X[19] = 12621;
Y[20] = 6750; X[20] = 11724;
Y[21] = 5750; X[21] = 10055;
Y[22] = 4750; X[22] = 8386;
Y[23] = 4270; X[23] = 5987;
Y[24] = 3791; X[24] = 3589;
Y[25] = 3791; X[25] = 626;
Y[26] = 3791; X[26] = 0;
Y[27] = 0; X[27] = 0;
Y[28] = 0; X[28] = 1084;
Y[29] = 83; X[29] = 5963;
Y[30] = 1021; X[30] = 9612;
Y[31] = 1959; X[31] = 13261;
Y[32] = 3543; X[32] = 15700;
Y[33] = 5127; X[33] = 18139;
Y[34] = 7232; X[34] = 19369;
Y[35] = 9337; X[35] = 20599;
Y[36] = 11796; X[36] = 20599;
Y[37] = 13338; X[37] = 20599;
Y[38] = 14588; X[38] = 20283;
Y[39] = 15839; X[39] = 19968;
Y[40] = 16860; X[40] = 19610;
Y[41] = 17882; X[41] = 19252;
Y[42] = 18736; X[42] = 18936;
Y[43] = 19590; X[43] = 18621;
Y[44] = 20340; X[44] = 18621;
Y[45] = 21091; X[45] = 18621;
Y[46] = 21820; X[46] = 18995;
Y[47] = 22550; X[47] = 19370;
Y[48] = 23133; X[48] = 20266;
Y[49] = 23717; X[49] = 21162;
Y[50] = 24092; X[50] = 22703;
Y[51] = 24467; X[51] = 24245;
Y[52] = 24551; X[52] = 26578;
Y[53] = 28133; X[53] = 26578;
/*Y[54] = 28216; X[54] = 24245;
Y[55] = 28612; X[55] = 22703;
Y[56] = 29008; X[56] = 21162;
Y[57] = 29612; X[57] = 20266;
Y[58] = 30216; X[58] = 19370;
Y[59] = 30965; X[59] = 18995;
Y[60] = 31714; X[60] = 18621;
Y[61] = 32548; X[61] = 18621;
Y[62] = 33381; X[62] = 18621;
Y[63] = 34276; X[63] = 18936;
Y[64] = 35172; X[64] = 19252;
Y[65] = 36255; X[65] = 19610;
Y[66] = 37338; X[66] = 19968;
Y[67] = 38670; X[67] = 20283;
Y[68] = 40003; X[68] = 20599;
Y[69] = 41669; X[69] = 20599;
Y[70] = 46917; X[70] = 20599;
Y[71] = 49749; X[71] = 15741;
Y[72] = 52581; X[72] = 10883;
Y[73] = 52665; X[73] = 1084;
Y[74] = 52665; X[74] = 0;
Y[75] = 48749; X[75] = 0;
Y[76] = 48749; X[76] = 626;
Y[77] = 48749; X[77] = 3589;
Y[78] = 48311; X[78] = 5987;
Y[79] = 47874; X[79] = 8386;
Y[80] = 46916; X[80] = 10055;
Y[81] = 45959; X[81] = 11724;
Y[82] = 44480; X[82] = 12621;
Y[83] = 43001; X[83] = 13518;
Y[84] = 40877; X[84] = 13518;
Y[85] = 39545; X[85] = 13518;
Y[86] = 38399; X[86] = 13243;
Y[87] = 37254; X[87] = 12969;
Y[88] = 36191; X[88] = 12652;
Y[89] = 35129; X[89] = 12336;
Y[90] = 34171; X[90] = 12083;
Y[91] = 33214; X[91] = 11831;
Y[92] = 32339; X[92] = 11831;
Y[93] = 31464; X[93] = 11831;
Y[94] = 30652; X[94] = 12164;
Y[95] = 29840; X[95] = 12497;
Y[96] = 29090; X[96] = 13309;
Y[97] = 28341; X[97] = 14122;
Y[98] = 27674; X[98] = 15476;
Y[99] = 27008; X[99] = 16830;
Y[100] = 26467; X[100] = 18871;*/
var textScale = C_SIZE/1000, // 1000 pt
alpha = textScale*25.4/96 /64; // коэффициент; используется для того чтобы перевести координаты в миллиметры
// при рисовании используем координаты в миллиметрах, умноженные на 100
// g_dKoef_px_to_mm = 25.4/96
var XX = [],
YY = [];
var hh1 = [],
hh2 = [];
var c1 = [],
c2 = [];
var delta = augm < 7 ? augm : 7;
if(augm < 7)
{
var RX = [],
RX1, RX2;
if(delta < 5.1)
{
hh1[0] = 1.89;
hh2[0] = 2.58;
hh1[1] = 1.55;
hh2[1] = 1.72;
hh1[2] = 1.5;
hh2[2] = 1.64;
hh1[3] = 1.92;
hh2[3] = 1.97;
// (!)
hh1[4] = 1;
hh2[4] = 1;
//
hh1[5] = 2.5;
hh2[5] = 2.5;
hh1[6] = 2.1;
hh2[6] = 2.1;
hh1[7] = 1;
hh2[7] = 1;
RX1 = 0.033*delta + 0.967;
RX2 = 0.033*delta + 0.967;
}
else
{
hh1[0] = 1.82;
hh2[0] = 2.09;
hh1[1] = 1.64;
hh2[1] = 1.65;
hh1[2] = 1.57;
hh2[2] = 1.92;
hh1[3] = 1.48;
hh2[3] = 2.16;
// (!)
hh1[4] = 1;
hh2[4] = 1;
//
hh1[5] = 2.5;
hh2[5] = 2.5;
hh1[6] = 2.1;
hh2[6] = 2.1;
hh1[7] = 1;
hh2[7] = 1;
RX1 = 0.22*delta + 0.78;
RX2 = 0.17*delta + 0.83;
}
for(var i = 0; i < 27; i++)
RX[i] = RX1;
for(var i = 27; i < 54; i++)
RX[i] = RX2;
RX[1] = (X[52]*RX[52] - (X[52] - X[1]) )/X[1];
RX[0] = RX[1]*X[1]/X[0];
RX[27] = 1;
RX[26] = 1;
for(var i = 0; i < 8; i++ )
RX[26-i] = 1 + i*((RX2+RX1)/2 - 1)/7;
for(var i = 0; i < 4; i++)
{
c1[i] = Y[30 + 2*i] - Y[28 + 2*i];
c2[i] = Y[23 - 2*i] - Y[25 - 2*i];
}
c1[5] = Y[48] - Y[44];
c2[5] = Y[5] - Y[9];
c1[6] = Y[52] - Y[48];
c2[6] = Y[1] - Y[5];
c1[7] = (Y[0] - Y[1])/2 + Y[1] - Y[52];
c2[7] = (Y[0] - Y[1])/2;
c1[4] = Y[44] - Y[36];
c2[4] = Y[9] - Y[17];
var rest1 = 0,
rest2 = 0;
for(var i = 0; i < 8; i++)
{
if(i == 4)
continue;
hh1[i] = (hh1[i] - 1)*(delta - 1) + 1;
hh2[i] = (hh2[i] - 1)*(delta - 1) + 1;
rest1 += hh1[i]*c1[i];
rest2 += hh2[i]*c2[i];
}
var H1 = delta*(Y[52] + c1[7]),
H2 = H1 - (Y[26] - Y[27]) ;
hh1[4] = (H1 - rest1)/c1[4];
hh2[4] = (H2 - rest2)/c2[4];
YY[27] = Y[27];
YY[26] = Y[26];
YY[28] = Y[27];
YY[25] = Y[26];
for(var i = 0; i < 4; i++)
{
for(var j = 1; j < 3; j ++)
{
var t = j + i*2;
YY[28 + t] = YY[27 + t] + (Y[28+t] - Y[27+t])*hh1[i];
YY[25 - t] = YY[26 - t] + (Y[25-t] - Y[26-t])*hh2[i];
}
}
//переопределяем 36 и 17
for(var i = 1; i < 9; i++)
{
YY[36 + i] = YY[35+i] + (Y[36+i] - Y[35+i])*hh1[4];
YY[17 - i] = YY[18-i] + (Y[17-i] - Y[18-i])*hh2[4];
}
for(var i = 0; i < 4; i++)
{
YY[45+i] = YY[44+i] + ( Y[45+i] - Y[44+i])*hh1[5];
YY[8-i] = YY[9-i] + (Y[8-i] -Y[9-i])*hh2[5];
}
for(var i = 0; i < 4; i++)
{
YY[49+i] = YY[48+i] + (Y[49+i] - Y[48+i])*hh1[6];
YY[4-i] = YY[5-i] + (Y[4-i] - Y[5-i] )*hh2[6];
}
YY[53] = YY[52] + 2*c1[7]*hh1[7];
YY[0] = YY[1] + 2*c2[7]*hh2[7];
}
else
{
hh1[0] = 1.75;
hh2[0] = 2.55;
hh1[1] = 1.62;
hh2[1] = 1.96;
hh1[2] = 1.97;
hh2[2] = 1.94;
hh1[3] = 1.53;
hh2[3] = 1.0;
hh1[4] = 2.04;
hh2[4] = 3.17;
hh1[5] = 2.0;
hh2[5] = 2.58;
hh1[6] = 2.3;
hh2[6] = 1.9;
hh1[7] = 2.3;
hh2[7] = 1.9;
// (!)
hh1[8] = 1;
hh2[8] = 1;
//
hh1[9] = 2.5;
hh2[9] = 2.5;
hh1[10] = 2.1;
hh2[10] = 2.1;
hh1[11] = 1;
hh2[11] = 1;
var rest1 = 0,
rest2 = 0;
for(var i=0; i<8; i++)
{
c1[i] = Y[30+i] - Y[29+i];
c2[i] = Y[24-i] - Y[25-i];
}
c1[9] = Y[48] - Y[44];
c2[9] = Y[5] - Y[9];
c1[10] = Y[52] - Y[48];
c2[10] = Y[1] - Y[5];
c1[11] = (Y[0] - Y[1])/2 + Y[1] - Y[52];
c2[11] = (Y[0] - Y[1])/2;
c1[8] = Y[44] - Y[36];
c2[8] = Y[9] - Y[17];
for(var i = 0; i < 12; i++)
{
if(i == 8)
continue;
hh1[i] = (hh1[i] - 1)*(delta - 1) + 1;
hh2[i] = (hh2[i] - 1)*(delta - 1) + 1;
rest1 += hh1[i]*c1[i];
rest2 += hh2[i]*c2[i];
}
var H1 = delta*(Y[52] + c1[11]),
H2 = H1 - (Y[26] - Y[27]) ;
hh1[8] = (H1 - rest1)/c1[8];
hh2[8] = (H2 - rest2)/c2[8];
YY[27] = Y[27];
YY[26] = Y[26];
YY[28] = Y[27];
YY[25] = Y[26];
for(var i = 0; i < 9; i++)
{
YY[28 + i] = YY[27 + i] + (Y[28+i] - Y[27+i])*hh1[i];
YY[25 - i] = YY[26 - i] + (Y[25-i] - Y[26-i])*hh2[i];
}
//переопределяем 36 и 17
for(var i = 1; i < 9; i++)
{
YY[36 + i] = YY[35+i] + (Y[36+i] - Y[35+i])*hh1[8];
YY[17 - i] = YY[18-i] + (Y[17-i] - Y[18-i])*hh2[8];
}
// TODO
// переделать
for(var i = 0; i < 4; i++)
{
YY[45+i] = YY[44+i] + ( Y[45+i] - Y[44+i])*hh1[9];
YY[8-i] = YY[9-i] + (Y[8-i] -Y[9-i])*hh2[9];
}
for(var i = 0; i < 4; i++)
{
YY[49+i] = YY[48+i] + (Y[49+i] - Y[48+i])*hh1[10];
YY[4-i] = YY[5-i] + (Y[4-i] - Y[5-i] )*hh2[10];
}
YY[53] = YY[52] + 2*c1[11]*hh1[11];
YY[0] = YY[1] + 2*c2[11]*hh2[11];
var RX = [];
for(var i = 0; i < 27; i++)
RX[i] = 0.182*delta + 0.818;
for(var i = 27; i < 54; i++)
RX[i] = 0.145*delta + 0.855;
RX[1] = (X[52]*RX[52] - (X[52] - X[1]) )/X[1];
RX[0] = RX[1]*X[1]/X[0];
RX[27] = 1;
RX[26] = 1;
for(var i = 0; i < 7; i++ )
RX[28-i] = 1 + i*(0.145*delta + 0.855 - 1)/8;
var w = X[33]*RX[33],
w2 = X[9]*RX[9] + 0.15*(X[9]*RX[9] - X[19]*RX[19]);
for(var i = 0; i < 11; i++)
{
RX[34+i] = w/X[34+i];
RX[19-i] = w2/X[19-i];
}
var _H1 = augm*(Y[52] + c1[11]),
_H2 = _H1 - (Y[26] - Y[27]);
var w3 = _H1 - (YY[52] + c1[11]),
w4 = _H2 - (YY[1] - YY[26] + c2[11]);
for(var i = 0; i < 10; i++)
{
YY[53 - i] = YY[53 - i] + w3;
YY[i] = YY[i] + w4;
}
}
var shiftX = 48 * textScale * 1000/72;
for(var i = 0; i < 54; i++)
{
XX[i] = (x + shiftX + X[i]*RX[i]*alpha );
YY[i] = (y + YY[i]*alpha );
}
for(var i = 0; i < 50; i++)
XX[54 + i] = XX[51 - i];
for(var i = 0; i < 50; i++)
YY[54 + i] = YY[53] + YY[52] - YY[51-i];
var penW = 1; //px
MathControl.pGraph.p_width(penW*1000);
MathControl.pGraph.b_color1(0,0,0, 255);
MathControl.pGraph._s();
MathControl.pGraph._m(XX[0], YY[0]);
MathControl.pGraph._l(XX[1], YY[1]);
MathControl.pGraph._c(XX[1], YY[1], XX[2], YY[2], XX[3], YY[3] );
MathControl.pGraph._c(XX[3], YY[3], XX[4], YY[4], XX[5], YY[5] );
MathControl.pGraph._c(XX[5], YY[5], XX[6], YY[6], XX[7], YY[7] );
MathControl.pGraph._c(XX[7], YY[7], XX[8], YY[8], XX[9], YY[9] );
MathControl.pGraph._c(XX[9], YY[9], XX[10], YY[10], XX[11], YY[11] );
MathControl.pGraph._c(XX[11], YY[11], XX[12], YY[12], XX[13], YY[13] );
MathControl.pGraph._c(XX[13], YY[13], XX[14], YY[14], XX[15], YY[15] );
MathControl.pGraph._c(XX[15], YY[15], XX[16], YY[16], XX[17], YY[17] );
MathControl.pGraph._c(XX[17], YY[17], XX[18], YY[18], XX[19], YY[19] );
MathControl.pGraph._c(XX[19], YY[19], XX[20], YY[20], XX[21], YY[21] );
MathControl.pGraph._c(XX[21], YY[21], XX[22], YY[22], XX[23], YY[23] );
MathControl.pGraph._c(XX[23], YY[23], XX[24], YY[24], XX[25], YY[25] );
MathControl.pGraph._l(XX[26], YY[26]);
MathControl.pGraph._l(XX[27], YY[27]);
MathControl.pGraph._l(XX[28], YY[28]);
MathControl.pGraph._c(XX[28], YY[28], XX[29], YY[29], XX[30], YY[30] );
MathControl.pGraph._c(XX[30], YY[30], XX[31], YY[31], XX[32], YY[32] );
MathControl.pGraph._c(XX[32], YY[32], XX[33], YY[33], XX[34], YY[34] );
MathControl.pGraph._c(XX[34], YY[34], XX[35], YY[35], XX[36], YY[36] );
MathControl.pGraph._c(XX[36], YY[36], XX[37], YY[37], XX[38], YY[38] );
MathControl.pGraph._c(XX[38], YY[38], XX[39], YY[39], XX[40], YY[40] );
MathControl.pGraph._c(XX[40], YY[40], XX[41], YY[41], XX[42], YY[42] );
MathControl.pGraph._c(XX[42], YY[42], XX[43], YY[43], XX[44], YY[44] );
MathControl.pGraph._c(XX[44], YY[44], XX[45], YY[45], XX[46], YY[46] );
MathControl.pGraph._c(XX[46], YY[46], XX[47], YY[47], XX[48], YY[48] );
MathControl.pGraph._c(XX[48], YY[48], XX[49], YY[49], XX[50], YY[50] );
MathControl.pGraph._c(XX[50], YY[50], XX[51], YY[51], XX[52], YY[52] );
MathControl.pGraph._l(XX[53], YY[53]);
MathControl.pGraph._c(XX[53], YY[53], XX[54], YY[54], XX[55], YY[55] );
MathControl.pGraph._c(XX[55], YY[55], XX[56], YY[56], XX[57], YY[57] );
MathControl.pGraph._c(XX[57], YY[57], XX[58], YY[58], XX[59], YY[59] );
MathControl.pGraph._c(XX[59], YY[59], XX[60], YY[60], XX[61], YY[61] );
MathControl.pGraph._c(XX[61], YY[61], XX[62], YY[62], XX[63], YY[63] );
MathControl.pGraph._c(XX[63], YY[63], XX[64], YY[64], XX[65], YY[65] );
MathControl.pGraph._c(XX[65], YY[65], XX[66], YY[66], XX[67], YY[67] );
MathControl.pGraph._c(XX[67], YY[67], XX[68], YY[68], XX[69], YY[69] );
MathControl.pGraph._c(XX[69], YY[69], XX[70], YY[70], XX[71], YY[71] );
MathControl.pGraph._c(XX[71], YY[71], XX[72], YY[72], XX[73], YY[73] );
MathControl.pGraph._c(XX[73], YY[73], XX[74], YY[74], XX[75], YY[75] );
MathControl.pGraph._c(XX[75], YY[75], XX[76], YY[76], XX[77], YY[77] );
MathControl.pGraph._l(XX[78], YY[78]);
MathControl.pGraph._l(XX[79], YY[79]);
MathControl.pGraph._l(XX[80], YY[80]);
MathControl.pGraph._c(XX[80], YY[80], XX[81], YY[81], XX[82], YY[82] );
MathControl.pGraph._c(XX[82], YY[82], XX[83], YY[83], XX[84], YY[84] );
MathControl.pGraph._c(XX[84], YY[84], XX[85], YY[85], XX[86], YY[86] );
MathControl.pGraph._c(XX[86], YY[86], XX[87], YY[87], XX[88], YY[88] );
MathControl.pGraph._c(XX[88], YY[88], XX[89], YY[89], XX[90], YY[90] );
MathControl.pGraph._c(XX[90], YY[90], XX[91], YY[91], XX[92], YY[92] );
MathControl.pGraph._c(XX[92], YY[92], XX[93], YY[93], XX[94], YY[94] );
MathControl.pGraph._c(XX[94], YY[94], XX[95], YY[95], XX[96], YY[96] );
MathControl.pGraph._c(XX[96], YY[96], XX[97], YY[97], XX[98], YY[98] );
MathControl.pGraph._c(XX[98], YY[98], XX[99], YY[99], XX[100], YY[100] );
MathControl.pGraph._c(XX[100], YY[100], XX[101], YY[101], XX[102], YY[102]);
MathControl.pGraph._c(XX[102], YY[102], XX[103], YY[103], XX[0], YY[0]);
MathControl.pGraph.df();
}
function checkBracket(font, Aug)
{
//var augm = + document.getElementById("augbr").value;
//augm = augm/100;
var x = 23,
y = 27;
var X = [],
Y = [];
Y[0] = 26467; X[0] = 18871;
Y[1] = 25967; X[1] = 18871;
Y[2] = 25384; X[2] = 16830;
Y[3] = 24737; X[3] = 15476;
Y[4] = 24091; X[4] = 14122;
Y[5] = 23341; X[5] = 13309;
Y[6] = 22591; X[6] = 12497;
Y[7] = 21778; X[7] = 12164;
Y[8] = 20965; X[8] = 11831;
Y[9] = 20089; X[9] = 11831;
Y[10] = 19214; X[10] = 11831;
Y[11] = 18317; X[11] = 12083;
Y[12] = 17421; X[12] = 12336;
Y[13] = 16441; X[13] = 12652;
Y[14] = 15462; X[14] = 12969;
Y[15] = 14357; X[15] = 13243;
Y[16] = 13253; X[16] = 13518;
Y[17] = 11961; X[17] = 13518;
Y[18] = 9835; X[18] = 13518;
Y[19] = 8292; X[19] = 12621;
Y[20] = 6750; X[20] = 11724;
Y[21] = 5750; X[21] = 10055;
Y[22] = 4750; X[22] = 8386;
Y[23] = 4270; X[23] = 5987;
Y[24] = 3791; X[24] = 3589;
Y[25] = 3791; X[25] = 626;
Y[26] = 3791; X[26] = 0;
Y[27] = 0; X[27] = 0;
Y[28] = 0; X[28] = 1084;
Y[29] = 83; X[29] = 5963;
Y[30] = 1021; X[30] = 9612;
Y[31] = 1959; X[31] = 13261;
Y[32] = 3543; X[32] = 15700;
Y[33] = 5127; X[33] = 18139;
Y[34] = 7232; X[34] = 19369;
Y[35] = 9337; X[35] = 20599;
Y[36] = 11796; X[36] = 20599;
Y[37] = 13338; X[37] = 20599;
Y[38] = 14588; X[38] = 20283;
Y[39] = 15839; X[39] = 19968;
Y[40] = 16860; X[40] = 19610;
Y[41] = 17882; X[41] = 19252;
Y[42] = 18736; X[42] = 18936;
Y[43] = 19590; X[43] = 18621;
Y[44] = 20340; X[44] = 18621;
Y[45] = 21091; X[45] = 18621;
Y[46] = 21820; X[46] = 18995;
Y[47] = 22550; X[47] = 19370;
Y[48] = 23133; X[48] = 20266;
Y[49] = 23717; X[49] = 21162;
Y[50] = 24092; X[50] = 22703;
Y[51] = 24467; X[51] = 24245;
Y[52] = 24551; X[52] = 26578;
Y[53] = 28133; X[53] = 26578;
/*Y[54] = 28216; X[54] = 24245;
Y[55] = 28612; X[55] = 22703;
Y[56] = 29008; X[56] = 21162;
Y[57] = 29612; X[57] = 20266;
Y[58] = 30216; X[58] = 19370;
Y[59] = 30965; X[59] = 18995;
Y[60] = 31714; X[60] = 18621;
Y[61] = 32548; X[61] = 18621;
Y[62] = 33381; X[62] = 18621;
Y[63] = 34276; X[63] = 18936;
Y[64] = 35172; X[64] = 19252;
Y[65] = 36255; X[65] = 19610;
Y[66] = 37338; X[66] = 19968;
Y[67] = 38670; X[67] = 20283;
Y[68] = 40003; X[68] = 20599;
Y[69] = 41669; X[69] = 20599;
Y[70] = 46917; X[70] = 20599;
Y[71] = 49749; X[71] = 15741;
Y[72] = 52581; X[72] = 10883;
Y[73] = 52665; X[73] = 1084;
Y[74] = 52665; X[74] = 0;
Y[75] = 48749; X[75] = 0;
Y[76] = 48749; X[76] = 626;
Y[77] = 48749; X[77] = 3589;
Y[78] = 48311; X[78] = 5987;
Y[79] = 47874; X[79] = 8386;
Y[80] = 46916; X[80] = 10055;
Y[81] = 45959; X[81] = 11724;
Y[82] = 44480; X[82] = 12621;
Y[83] = 43001; X[83] = 13518;
Y[84] = 40877; X[84] = 13518;
Y[85] = 39545; X[85] = 13518;
Y[86] = 38399; X[86] = 13243;
Y[87] = 37254; X[87] = 12969;
Y[88] = 36191; X[88] = 12652;
Y[89] = 35129; X[89] = 12336;
Y[90] = 34171; X[90] = 12083;
Y[91] = 33214; X[91] = 11831;
Y[92] = 32339; X[92] = 11831;
Y[93] = 31464; X[93] = 11831;
Y[94] = 30652; X[94] = 12164;
Y[95] = 29840; X[95] = 12497;
Y[96] = 29090; X[96] = 13309;
Y[97] = 28341; X[97] = 14122;
Y[98] = 27674; X[98] = 15476;
Y[99] = 27008; X[99] = 16830;
Y[100] = 26467; X[100] = 18871;*/
var textScale = font.FontSize, // 1000 pt
alpha = textScale*25.4/96 /64; // коэффициент; используется для того чтобы перевести координаты в миллиметры
// при рисовании используем координаты в миллиметрах, умноженные на 100
// теперь не умножаем на 100 =)
// g_dKoef_px_to_mm = 25.4/96
var augm = Aug;
var XX = [],
YY = [];
var hh1 = [],
hh2 = [];
var c1 = [],
c2 = [];
for(var i = 0; i < 4; i++)
{
//hh1[i] = hh2[i] = 1 + 0.3*i;
c1[i] = Y[30 + 2*i] - Y[28 + 2*i];
c2[i] = Y[23 - 2*i] - Y[25 - 2*i];
}
/*hh1[0] = 1.2;
hh2[0] = 1.3;
hh1[1] = 1.3;
hh2[1] = 1.5;
hh1[2] = 1.5;
hh2[2] = 1.7;
hh1[3] = hh2[3] = 2.1;*/
hh1[0] = 1.2;
hh2[0] = 1.3;
hh1[1] = 1.3;
hh2[1] = 1.4;
hh1[2] = 1.5;
hh2[2] = 1.6;
hh1[3] = 1.8;
hh2[3] = 1.6;
for(var i = 0; i < 4; i++)
{
hh1[i] += 0.5;
hh2[i] += 0.5;
}
hh1[5] = 2.5;
hh2[5] = 2.5;
c1[5] = Y[48] - Y[44];
c2[5] = Y[5] - Y[9];
hh1[6] = 2.1;
hh2[6] = 2.1;
c1[6] = Y[52] - Y[48];
c2[6] = Y[1] - Y[5];
hh1[7] = 1;
hh2[7] = 1;
c1[7] = (Y[0] - Y[1])/2 + Y[1] - Y[52];
c2[7] = (Y[0] - Y[1])/2;
c1[4] = Y[44] - Y[36];
c2[4] = Y[9] - Y[17];
var delta = augm < 7 ? augm : 7;
//var delta = augm;
var rest1 = 0,
rest2 = 0;
for(var i = 0; i < 8; i++)
{
if(i == 4)
continue;
hh1[i] = (hh1[i] - 1)*(delta - 1) + 1;
hh2[i] = (hh2[i] - 1)*(delta - 1) + 1;
rest1 += hh1[i]*c1[i];
rest2 += hh2[i]*c2[i];
}
var H1 = delta*(Y[52] + c1[7]),
H2 = H1 - (Y[26] - Y[27]) ;
hh1[4] = (H1 - rest1)/c1[4];
hh2[4] = (H2 - rest2)/c2[4];
YY[27] = Y[27];
YY[26] = Y[26];
YY[28] = Y[27];
YY[25] = Y[26];
for(var i = 0; i < 4; i++)
{
for(var j = 1; j < 3; j ++)
{
var t = j + i*2;
YY[28 + t] = YY[27 + t] + (Y[28+t] - Y[27+t])*hh1[i];
YY[25 - t] = YY[26 - t] + (Y[25-t] - Y[26-t])*hh2[i];
}
}
//переопределяем 36 и 17
for(var i = 1; i < 9; i++)
{
YY[36 + i] = YY[35+i] + (Y[36+i] - Y[35+i])*hh1[4];
YY[17 - i] = YY[18-i] + (Y[17-i] - Y[18-i])*hh2[4];
}
for(var i = 0; i < 4; i++)
{
YY[45+i] = YY[44+i] + ( Y[45+i] - Y[44+i])*hh1[5];
YY[8-i] = YY[9-i] + (Y[8-i] -Y[9-i])*hh2[5];
}
for(var i = 0; i < 4; i++)
{
YY[49+i] = YY[48+i] + (Y[49+i] - Y[48+i])*hh1[6];
YY[4-i] = YY[5-i] + (Y[4-i] - Y[5-i] )*hh2[6];
}
YY[53] = YY[52] + 2*c1[7]*hh1[7];
YY[0] = YY[1] + 2*c2[7]*hh2[7];
var shiftX = 48 * textScale * 1000/72;
//var RX = 0.04*delta + 0.96;
var RX = 0.145*delta + 0.855;
for(var i = 27; i < 54; i++)
XX[i] = RX*X[i];
for(var i = 0; i < 27; i++)
{
XX[i] = (0.17*delta + 0.83)*X[i];
}
XX[1] = XX[52] - (X[52] - X[1]);
XX[0] = XX[1];
XX[27] = X[27];
XX[26] = X[26];
for(var i = 0; i < 9; i++ )
{
XX[28 - i] = X[28 - i]*(1 + i*(RX - 1)/8);
}
if(augm > 7)
{
var w = XX[33],
//w2 = XX[19] + (XX[9] - XX[19])/2;
w2 = XX[9] + 0.15*(XX[9] - XX[19]);
for(var i = 0; i < 11; i++)
{
XX[34 + i] = w;
XX[19 - i] = w2;
}
var _H1 = augm*(Y[52] + c1[7]),
_H2 = _H1 - (Y[26] - Y[27]);
var w3 = _H1 - (YY[52] + c1[7]),
w4 = _H2 - (YY[1] - YY[26] + c2[7]);
for(var i = 0; i < 10; i++)
{
YY[53 - i] = YY[53 - i] + w3;
YY[i] = YY[i] + w4;
}
//YY[53] = YY[52] + 2*c1[7];
//YY[0] = YY[1] + 2*c2[7];
}
return {_XX: XX, _YY: YY};
}
\ No newline at end of file
"use strict";
var CF_X1 = 0.29;
var CF_X2 = 0.34;
var CF_X3 = 0.07;
var CF_X4 = 0.36;
var CF_X5 = 0;
var CF_X6 = 0.36;
var CF_Y1 = 0.78;
var CF_Y2 = 0.79;
/*var CF_Y3 = 0.84;
var CF_Y4 = 1.0;
var CF_Y5 = 0.77;
var CF_Y6 = 0.85;*/
var CF_Y3 = 0.75;
var CF_Y4 = 1.0;
var CF_Y5 = 0.75;
var CF_Y6 = 0.84;
//var COEFF_TH = 0.73;
var COEFF_TH = 0.81;
var CF_WIDTH = 1.3;
var CF_HEIGHT = 1;
var U_SIZE = 36/0.76;
function DrawUnion()
{
/*var augm = + document.getElementById("CoeffUnion").value;
augm = augm/100;*/
var x = 23,
y = 27;
var betta = U_SIZE/36;
//var _width = 1.3*9.6159*betta,
var _width = CF_WIDTH*9.6159*betta,
//var _width = 10.312548828125*betta,
_height = 11.994444444444444*betta;
var gap = 0.93*betta;
var X = [],
Y = [];
/*X[0] = 10125; Y[0] = 56563;
X[1] = 10125; Y[1] = 0;
X[2] = 0; Y[2] = 0;
X[3] = 0; Y[3] = 56313;
X[4] = 0; Y[4] = 76750;
X[5] = 9031; Y[5] = 87032;
X[6] = 18063; Y[6] = 97313;
X[7] = 35438; Y[7] = 97313;
X[8] = 52813; Y[8] = 97313;
X[9] = 61875; Y[9] = 87251;
X[10] = 70938; Y[10] = 77188;
X[11] = 70938; Y[11] = 58938;
X[12] = 70938; Y[12] = 0;
X[13] = 60813; Y[13] = 0;
X[14] = 60813; Y[14] = 56563;
X[15] = 60813; Y[15] = 72938;
X[16] = 54375; Y[16] = 80782;
X[17] = 47938; Y[17] = 88625;
X[18] = 35438; Y[18] = 88625;
X[19] = 22938; Y[19] = 88625;
X[20] = 16531; Y[20] = 80782;
X[21] = 10125; Y[21] = 72938;
X[22] = 10125; Y[22] = 56563;*/
X[0] = 35438; Y[0] = 88625;
X[1] = 22938; Y[1] = 88625;
X[2] = 16531; Y[2] = 80782;
X[3] = 10125; Y[3] = 72938;
X[4] = 10125; Y[4] = 56563;
X[5] = 10125; Y[5] = 0;
X[6] = 0; Y[6] = 0;
X[7] = 0; Y[7] = 56313;
X[8] = 0; Y[8] = 76750;
X[9] = 9031; Y[9] = 87032;
X[10] = 18063; Y[10] = 97313;
X[11] = 35438; Y[11] = 97313;
var textScale = U_SIZE/1000, // 1000 pt
alpha = textScale*25.4/96 /64;
//var thick = X[1] - X[2];
var thick = (X[5] - X[6])*COEFF_TH;
var Width_1 = (_width - gap)/alpha - 2*thick,
Height = _height/alpha;
var w1 = X[2] - X[4],
w2 = X[0] - X[2],
w3 = X[3] - X[4],
w4 = X[1] - X[2];
/*var k1 = w3/w1,
k2 = w4/w2;*/
var k1 = CF_X3,
k2 = CF_X4;
var WW1 = CF_X1*Width_1/2,
WW2 = WW1*k1,
WW3 = (1- CF_X1)*Width_1/2 *k2;
X[4] *= COEFF_TH;
X[5] *= COEFF_TH;
X[2] = X[4] + WW1;
X[3] = X[4] + WW2;
X[1] = X[4] + WW3 + WW1;
X[0] = X[4] + Width_1/2;
var Width_2 = (_width - gap)/alpha;
var w5 = X[9] - X[7],
w6 = X[11] - X[9],
w7 = X[8] - X[7],
w8 = X[10] - X[9];
/*var k3 = w7/w5,
k4 = w8/w6;*/
var k3 = CF_X5,
k4 = CF_X6;
var WW4 = CF_X2*Width_2/ 2,
WW5 = WW4*k3,
WW6 = (1- CF_X2)*Width_2/2 *k4;
X[8] = X[7] + WW5;
X[9] = X[7] + WW4;
X[10] = X[7] + WW4 + WW6;
X[11] = X[7] + Width_2/2;
var Width = (_width - gap)/alpha;
var HH = (Y[0] - Y[4])*CF_HEIGHT,
h1 = (Y[2] - Y[4])*CF_HEIGHT,
h2 = (Y[0] - Y[2])*CF_HEIGHT;
Y[2] = Y[4] + HH*CF_Y1;
Y[3] = Y[4] + h1*CF_Y3;
Y[1] = Y[4] + HH*CF_Y1 +h2*CF_Y4;
Y[0] = Y[4] + HH;
var HH2 = (Y[11] - Y[7])*CF_HEIGHT,
h3 = (Y[9] - Y[7])*CF_HEIGHT,
h4 = (Y[11] - Y[9])*CF_HEIGHT;
Y[9] = Y[7] + HH2*CF_Y2;
Y[8] = Y[7] + h3*CF_Y5;
Y[10] = Y[7] + HH2*CF_Y2 + h4*CF_Y6;
Y[11] = Y[7] + HH2;
var HH = Y[4]*0.68;
for(var i = 0; i < 5; i++)
{
Y[i] += HH;
Y[7+i] += HH;
}
for(var i = 0; i < 11; i++)
{
X[22 - i] = Width - X[i];
Y[22 - i] = Y[i];
}
var XX = [],
YY = [];
for(var i = 0; i < 23; i++)
{
var xxx = X[i] + 7100;
var str = "X[" + i +"] = " + xxx + "; Y[" + i + "] = " + Y[i] + ";";
console.log(str);
}
for(var i = 0; i < 23; i++)
{
XX[i] = x + X[i]*alpha;
YY[i] = y + Y[i]*alpha;
}
var intGrid = MathControl.pGraph.GetIntegerGrid();
MathControl.pGraph.SetIntegerGrid(false);
MathControl.pGraph.p_width(1000);
MathControl.pGraph.b_color1(0,0,0, 255);
MathControl.pGraph.p_color(0,0,0, 255);
MathControl.pGraph._s();
MathControl.pGraph._m(XX[0], YY[0]);
MathControl.pGraph._c(XX[0], YY[0], XX[1], YY[1], XX[2], YY[2]);
MathControl.pGraph._c(XX[2], YY[2], XX[3], YY[3], XX[4], YY[4]);
MathControl.pGraph._l(XX[5], YY[5]);
MathControl.pGraph._l(XX[6], YY[6]);
MathControl.pGraph._l(XX[7], YY[7]);
MathControl.pGraph._c(XX[7], YY[7], XX[8], YY[8], XX[9], YY[9]);
MathControl.pGraph._c(XX[9], YY[9], XX[10], YY[10], XX[11], YY[11]);
MathControl.pGraph._c(XX[11], YY[11], XX[12], YY[12], XX[13], YY[13]);
MathControl.pGraph._c(XX[13], YY[13], XX[14], YY[14], XX[15], YY[15]);
MathControl.pGraph._l(XX[16], YY[16]);
MathControl.pGraph._l(XX[17], YY[17]);
MathControl.pGraph._l(XX[18], YY[18]);
MathControl.pGraph._c(XX[18], YY[18], XX[19], YY[19], XX[20], YY[20]);
MathControl.pGraph._c(XX[20], YY[20], XX[21], YY[21], XX[22], YY[22]);
MathControl.pGraph.df();
MathControl.pGraph.SetIntegerGrid(intGrid);
}
"use strict";
var DEGR_REDUCT = 0.728;
var default_font = {FontFamily : {Name : "Cambria Math", Index : -1 }, FontSize : 36};
//var metricsDF = {};
function GetMathFont(GFont)
{
g_oTextMeasurer.SetFont(GFont);
var metrics =
{
Height: g_oTextMeasurer.GetHeight(),
Descender: (-1)*g_oTextMeasurer.GetDescender(),
Placeholder: g_oTextMeasurer.Measure2Code( StartTextElement )
};
var Fnt =
{
FontSize: GFont.FontSize,
FontFamily : Common_CopyObj(GFont.FontFamily),
metrics: metrics
};
return Fnt;
}
/*function GetMetrics(value, font)
{
g_oTextMeasurer.SetFont(type.font);
return g_oTextMeasurer.Measure2Code(value);
}*/
/*function getTypeHeight(h)
{
var H1 = metricsDF.Height + metricsDF.Descender + metricsDF.Placeholder.Height,
H2 = 2.5*metricsDF.Placeholder.Height,
H3 = H1 + metricsDF.Placeholder.Height,
H4 = H3 + metricsDF.Descender,
H5 = H3 + H1;
var type = null;
if(h < H2)
type = 0;
else if(h < H4)
type = 1;
else if(h < H5)
type = 2;
else
type = 3;
return type;
}*/
function getStateHeight(height, print)
{
var metric = print.metrics;
var state = null;
var H1 = metric.Height + metric.Descender + metric.Placeholder.Height,
H2 = 2.5*metric.Placeholder.Height,
H3 = H1 + metric.Placeholder.Height,
H4 = H3 + metric.Descender,
H5 = H3 + H1;
if(height < H2)
state = 0;
else if(height < H4)
state = 1;
else if(height < H5)
state = 2;
else
state = 3;
return state;
}
function getMaxHeight(print)
{
var metric = print.metrics;
var H1 = metric.Height + metric.Descender + metric.Placeholder.Height,
H2 = 2.5*metric.Placeholder.Height,
H3 = H1 + metric.Placeholder.Height,
H4 = H3 + metric.Descender,
H5 = H3 + H1;
return H5;
}
function getStateHeight_2(height, GFont)
{
var metric = GFont.metrics;
var state = null;
var gap = metric.Height - metric.Placeholder.Height;
var H1 = metric.Height,
H2 = H1 + gap,
H3 = 2*metric.Placeholder.Height + gap,
H4 = 3*metric.Placeholder.Height + 2*gap,
H5 = 4*metric.Placeholder.Height + 2*gap;
if( height < H1 )
state = 0;
else if( height < H3 )
state = 1;
else if( height < H4 )
state = 2;
else if( height < H5 )
state = 3;
else
state = 4;
return state;
}
function getTypeDegree(IFont, flag)
{
var fontSize = null;
var CONST_INDEX = flag ? 0.62 : 0.728;
var sD = IFont.FontSize*CONST_INDEX;
if( sD - Math.floor(sD) > 0.65 )
fontSize = Math.ceil(sD) - 0.5;
else
fontSize = Math.floor(sD);
var GFont = {FontFamily: IFont.FontFamily, FontSize: fontSize};
var IFont = GetMathFont(GFont);
return IFont;
}
function getStateHeight_1(height, GFont)
{
var metric = GFont.metrics,
state = 0;
var gap = metric.Height - metric.Placeholder.Height;
var H5 = 5*metric.Placeholder.Height + 4*gap;
if(H5 < height)
state = 3;
return state;
}
function getMaxHeight_1(print)
{
var metric = print.metrics;
var gap = metric.Height - metric.Placeholder.Height;
return 5*metric.Placeholder.Height + 4*gap;
}
function getStateHeight_3( height, GFont) //for radical
{
var metric = GFont.metrics,
GenHeight;
var gap = metric.Height - metric.Placeholder.Height;
var H0 = metric.Placeholder.Height,
H1 = metric.Height,
H2 = 2*metric.Placeholder.Height + 1.5*gap,
H3 = 3*metric.Placeholder.Height + 2.4*gap,
H4 = 4*metric.Placeholder.Height + 3*gap,
H5 = 5*metric.Placeholder.Height + 4*gap;
if(height < H0)
GenHeight = H1*0.75;
else if( height < H1 )
GenHeight = H1;
else if( height < H2 )
GenHeight = H2;
else if( height < H3 )
GenHeight = H3;
else if( height < H4 )
GenHeight = H4;
else if(height < H5)
GenHeight = H5;
else
GenHeight = height;
return GenHeight;
}
\ No newline at end of file
...@@ -4668,89 +4668,3 @@ CMathContent.prototype = ...@@ -4668,89 +4668,3 @@ CMathContent.prototype =
} }
} }
function TEST_MATH_EDIT()
{
//MathComposition.test_for_edit();
MathComposition.test_for_edit();
MathComposition.RecalculateComposition(g_oTextMeasurer, MathComposition.DEFAULT_RUN_PRP);
//MathComposition.Draw_2(x, y, )
editor.WordControl.m_oLogicDocument.DrawingDocument.OnRecalculatePage(0, { Width : Page_Width, Height : Page_Height, Margins : {
Left : X_Left_Field,
Right : X_Right_Field,
Top : Y_Top_Field,
Bottom : Y_Bottom_Field
} } );
}
function TEST_COEFF_ITERATORS()
{
// a*36*36 + b*36 + c = 0.728*tPrp.FontSize = 26
// a*14*14 + b*14 + c = 9
// a*72*72 + b*72 + c = 55
//FSize = 0.0006*FSize*FSize + 0.743*FSize - 1.53;
// argSize = -1
//var x1 = 36, x2 = 14, x3 = 72;
//var d1 = 26, d2 = 10, d3 = 54; // если еще подгонять, то можно d3 = 53,52 взять
var x1 = 36, x2 = 14, x3 = 72;
var d1 = 24, d2 = 10, d3 = 47;
// || x1*x1 x1 1 ||
// || x2*x2 x2 1 ||
// || x3*x3 x3 1 ||
var D = x1*x1*x2 + x1*x3*x3 + x2*x2*x3 - x3*x3*x2 - x3*x1*x1 - x2*x2*x1,
Da = d1*x2 + x1*d3 + d2*x3 - d3*x2 - x3*d1 - d2*x1,
Db = x1*x1*d2 + d1*x3*x3 + x2*x2*d3 - x3*x3*d2 - d3*x1*x1 - x2*x2*d1,
Dc = x1*x1*x2*d3 + x1*x3*x3*d2 + x2*x2*x3*d1 - x3*x3*x2*d1 - x3*x1*x1*d2 - x2*x2*x1*d3;
var a = Da/D,
b = Db/D,
c = Dc/D;
console.log("a: " + a + " b: " + b + " c: " + c);
var check1 = a*x1*x1 + b*x1 + c - d1,
check2 = a*x2*x2 + b*x2 + c - d2,
check3 = a*x3*x3 + b*x3 + c - d3;
console.log("check1: " + check1);
console.log("check2: " + check2);
console.log("check3: " + check3);
var aa = Math.round(a*10000)/10000;
var dd1 = d1 - a*x1*x1,
dd2 = d2 - a*x2*x2;
var DD = x1 - x2,
Dbb = dd1 - dd2,
Dcc = x1*dd2 - x2*dd1;
var bb = Dbb/DD,
cc = Dcc/DD;
bb = Math.round(bb*100)/100;
cc = Math.round(cc*100)/100;
console.log("aa: " + aa + " bb: " + bb + " cc: " + cc);
var check11 = aa*x1*x1 + bb*x1 + cc - d1,
check22 = aa*x2*x2 + bb*x2 + cc - d2,
check33 = aa*x3*x3 + bb*x3 + cc - d3;
console.log("check11: " + check11);
console.log("check22: " + check22);
console.log("check33: " + check33);
}
\ No newline at end of file
...@@ -54,7 +54,6 @@ function CMathMatrixPr() ...@@ -54,7 +54,6 @@ function CMathMatrixPr()
this.baseJc = BASEJC_CENTER; this.baseJc = BASEJC_CENTER;
this.plcHide = false; this.plcHide = false;
} }
CMathMatrixPr.prototype.Set_FromObject = function(Obj) CMathMatrixPr.prototype.Set_FromObject = function(Obj)
{ {
if (undefined !== Obj.row && null !== Obj.row) if (undefined !== Obj.row && null !== Obj.row)
...@@ -99,7 +98,6 @@ CMathMatrixPr.prototype.Set_FromObject = function(Obj) ...@@ -99,7 +98,6 @@ CMathMatrixPr.prototype.Set_FromObject = function(Obj)
return nColumnsCount; return nColumnsCount;
}; };
CMathMatrixPr.prototype.Get_ColumnsCount = function() CMathMatrixPr.prototype.Get_ColumnsCount = function()
{ {
var nColumnsCount = 0; var nColumnsCount = 0;
...@@ -109,7 +107,6 @@ CMathMatrixPr.prototype.Get_ColumnsCount = function() ...@@ -109,7 +107,6 @@ CMathMatrixPr.prototype.Get_ColumnsCount = function()
} }
return nColumnsCount; return nColumnsCount;
}; };
CMathMatrixPr.prototype.Write_ToBinary = function(Writer) CMathMatrixPr.prototype.Write_ToBinary = function(Writer)
{ {
// Long : row // Long : row
...@@ -137,7 +134,6 @@ CMathMatrixPr.prototype.Write_ToBinary = function(Writer) ...@@ -137,7 +134,6 @@ CMathMatrixPr.prototype.Write_ToBinary = function(Writer)
this.mcs[nIndex].Write_ToBinary(Writer); this.mcs[nIndex].Write_ToBinary(Writer);
} }
}; };
CMathMatrixPr.prototype.Read_FromBinary = function(Reader) CMathMatrixPr.prototype.Read_FromBinary = function(Reader)
{ {
// Long : row // Long : row
...@@ -167,82 +163,22 @@ CMathMatrixPr.prototype.Read_FromBinary = function(Reader) ...@@ -167,82 +163,22 @@ CMathMatrixPr.prototype.Read_FromBinary = function(Reader)
} }
}; };
function CMathMatrix(props)
{
CMathMatrix.superclass.constructor.call(this);
this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_MATRIX;
this.Pr = new CMathMatrixPr();
this.spaceRow = null;
this.spaceColumn = null;
this.gaps = null;
this.column = 0;
this.setDefaultSpace();
if(props !== null && typeof(props) !== "undefined")
this.init(props);
g_oTableId.Add( this, this.Id ); function CMatrixBase()
}
Asc.extendClass(CMathMatrix, CMathBase);
CMathMatrix.prototype.init = function(props)
{ {
this.setProperties(props); CMatrixBase.superclass.constructor.call(this);
this.fillContent();
} }
CMathMatrix.prototype.setDefaultSpace = function() Asc.extendClass(CMatrixBase, CMathBase);
CMatrixBase.prototype.recalculateSize = function(oMeasure, RPI)
{ {
this.spaceRow = if(this.RecalcInfo.bProps)
{
rule: 0,
gap: 0,
minGap: 13/12 // em
// 780 /20 (pt) for font 36 pt
// minGap: 0
};
this.spaceColumn =
{
rule: 0,
gap: 0,
minGap: 0 // minGap / 20 pt
};
this.gaps =
{ {
row: [], if(this.nRow > 1)
column: [] this.setRuleGap(this.spaceRow, this.Pr.rSpRule, this.Pr.rSp);
};
}
CMathMatrix.prototype.setRuleGap = function(oSpace, rule, gap, minGap)
{
var bInt = rule == rule - 0 && rule == rule^ 0,
bRule = rule >= 0 && rule <= 4;
if(bInt && bRule)
oSpace.rule = rule;
else
oSpace.rule = 0;
if(gap == gap - 0 && gap == gap^0)
oSpace.gap = gap;
else
oSpace.gap = 0;
if(minGap == minGap - 0 && minGap == minGap^0) if(this.nCol > 1)
oSpace.minGap = minGap;
}
CMathMatrix.prototype.recalculateSize = function(oMeasure, RPI)
{
if(this.RecalcInfo.bProps)
{ {
this.setRuleGap(this.spaceColumn, this.Pr.cGpRule, this.Pr.cGp, this.Pr.cSp); this.setRuleGap(this.spaceColumn, this.Pr.cGpRule, this.Pr.cGp, this.Pr.cSp);
this.setRuleGap(this.spaceRow, this.Pr.rSpRule, this.Pr.rSp);
var lng = this.Pr.mcs.length; var lng = this.Pr.mcs.length;
var col = 0; var col = 0;
...@@ -260,39 +196,49 @@ CMathMatrix.prototype.recalculateSize = function(oMeasure, RPI) ...@@ -260,39 +196,49 @@ CMathMatrix.prototype.recalculateSize = function(oMeasure, RPI)
col++; col++;
} }
} }
}
if(this.Pr.plcHide) if(this.kind == MATH_MATRIX && this.Pr.plcHide)
this.hidePlaceholder(true); this.hidePlaceholder(true);
this.RecalcInfo.bProps = false; this.RecalcInfo.bProps = false;
} }
var txtPrp = this.Get_CompiledCtrPrp(); var txtPrp = this.Get_CompiledCtrPrp();
var metrics = this.getMetrics();
var gapsCol = this.getLineGap(txtPrp); if(this.nCol > 1)
{
//var gapsCol = this.getLineGap(txtPrp);
var gapsCol = this.getLineGap(this.spaceColumn, txtPrp);
for(var i = 0; i < this.nCol - 1; i++) for(var i = 0; i < this.nCol - 1; i++)
this.gaps.column[i] = gapsCol; this.gaps.column[i] = gapsCol;
}
this.gaps.column[this.nCol - 1] = 0; this.gaps.column[this.nCol - 1] = 0;
var intervalRow = this.getRowSpace(txtPrp); if(this.nRow > 1)
{
//var intervalRow = this.getRowSpace(txtPrp);
var intervalRow = this.getRowSpace(this.spaceRow, txtPrp);
var divCenter = 0; var divCenter = 0;
var metrics = this.getMetrics(RPI);
var plH = 0.2743827160493827 * txtPrp.FontSize; var plH = 0.2743827160493827 * txtPrp.FontSize;
var minGp = this.spaceRow.minGap*txtPrp.FontSize*g_dKoef_pt_to_mm; var minGp = this.spaceRow.minGap*txtPrp.FontSize*g_dKoef_pt_to_mm;
minGp -= plH; minGp -= plH;
for(var j = 0; j < this.nRow - 1; j++) for(var j = 0; j < this.nRow - 1; j++)
{ {
divCenter = intervalRow - (metrics.descents[j] + metrics.ascents[j + 1]); divCenter = intervalRow - (metrics.descents[j] + metrics.ascents[j + 1]);
this.gaps.row[j] = minGp > divCenter ? minGp : divCenter; this.gaps.row[j] = minGp > divCenter ? minGp : divCenter;
} }
}
this.gaps.row[this.nRow - 1] = 0; this.gaps.row[this.nRow - 1] = 0;
var height = 0, width = 0; var height = 0, width = 0;
for(var i = 0; i < this.nCol; i++) for(var i = 0; i < this.nCol; i++)
...@@ -328,41 +274,114 @@ CMathMatrix.prototype.recalculateSize = function(oMeasure, RPI) ...@@ -328,41 +274,114 @@ CMathMatrix.prototype.recalculateSize = function(oMeasure, RPI)
this.size = {width: width, height: height, ascent: ascent}; this.size = {width: width, height: height, ascent: ascent};
} }
CMathMatrix.prototype.setPosition = function(pos, PosInfo) CMatrixBase.prototype.baseJustification = function(type)
{ {
this.pos.x = pos.x; this.Pr.baseJc = type;
};
CMatrixBase.prototype.setDefaultSpace = function()
{
this.spaceRow =
{
rule: 0,
gap: 0,
minGap: 13/12 // em
// 780 /20 (pt) for font 36 pt
// minGap: 0
};
this.spaceColumn =
{
rule: 0,
gap: 0,
minGap: 0 // minGap / 20 pt
};
if(this.bInside === true) this.gaps =
this.pos.y = pos.y; {
row: [],
column: []
};
}
CMatrixBase.prototype.setRuleGap = function(oSpace, rule, gap, minGap)
{
var bInt = rule == rule - 0 && rule == rule^0,
bRule = rule >= 0 && rule <= 4;
if(bInt && bRule)
oSpace.rule = rule;
else else
this.pos.y = pos.y - this.size.ascent; ///!!!! oSpace.rule = 0;
var maxWH = this.getWidthsHeights(); if(gap == gap - 0 && gap == gap^0)
var Widths = maxWH.widths; oSpace.gap = gap;
var Heights = maxWH.heights; else
oSpace.gap = 0;
var NewPos = new CMathPosition(); if(minGap == minGap - 0 && minGap == minGap^0)
oSpace.minGap = minGap;
};
CMatrixBase.prototype.getLineGap = function(spaceColumn, txtPrp)
{
var spLine;
var h = 0, w = 0; if(spaceColumn.rule == 0)
spLine = 1; //em
else if(spaceColumn.rule == 1)
spLine = 1.5; //em
else if(spaceColumn.rule == 2)
spLine = 2; //em
else if(spaceColumn.rule == 3)
spLine = spaceColumn.gap/20; //pt
else if(spaceColumn.rule == 4)
spLine = spaceColumn.gap/2; //em
else
spLine = 1;
var lineGap;
for(var i=0; i < this.nRow; i++) if(spaceColumn.rule == 3)
{ lineGap = spLine*g_dKoef_pt_to_mm; //pt
w = 0; else
for(var j = 0; j < this.nCol; j++) lineGap = spLine*txtPrp.FontSize*g_dKoef_pt_to_mm; //em
{
var al = this.align(i, j);
NewPos.x = this.pos.x + this.GapLeft + al.x + w;
NewPos.y = this.pos.y + al.y + h;
this.elements[i][j].setPosition(NewPos, PosInfo); var wPlh = 0.3241834852430555 * txtPrp.FontSize;
w += Widths[j] + this.gaps.column[j];
}
h += Heights[i] + this.gaps.row[i];
}
} var min = spaceColumn.minGap / 20 * g_dKoef_pt_to_mm - wPlh;
CMathMatrix.prototype.Get_ParaContentPosByXY = function(SearchPos, Depth, _CurLine, _CurRange, StepEnd) lineGap = Math.max(lineGap, min);
//lineGap += this.params.font.metrics.Placeholder.Height; // для случая, когда gapRow - (аскент + дескент) > minGap, вычитаем из gap строки, а здесь прибавляем стандартный metrics.Height
return lineGap;
};
CMatrixBase.prototype.getRowSpace = function(spaceRow, txtPrp)
{
var spLine;
if(spaceRow.rule == 0)
spLine = 7/6; //em
else if(spaceRow.rule == 1)
spLine = 7/6 *1.5; //em
else if(spaceRow.rule == 2)
spLine = 7/6 *2; //em
else if(spaceRow.rule == 3)
spLine = spaceRow.gap/20; //pt
else if(spaceRow.rule == 4)
spLine = 7/6 * spaceRow.gap/2; //em
else
spLine = 7/6;
var lineGap;
if(spaceRow.rule == 3)
lineGap = spLine*g_dKoef_pt_to_mm; //pt
else
lineGap = spLine*txtPrp.FontSize*g_dKoef_pt_to_mm; //em
var min = spaceRow.minGap*txtPrp.FontSize*g_dKoef_pt_to_mm;
lineGap = Math.max(lineGap, min);
return lineGap;
};
CMatrixBase.prototype.Get_ParaContentPosByXY = function(SearchPos, Depth, _CurLine, _CurRange, StepEnd)
{ {
var maxWH = this.getWidthsHeights(); var maxWH = this.getWidthsHeights();
var Widths = maxWH.widths; var Widths = maxWH.widths;
...@@ -454,6 +473,69 @@ CMathMatrix.prototype.Get_ParaContentPosByXY = function(SearchPos, Depth, _CurLi ...@@ -454,6 +473,69 @@ CMathMatrix.prototype.Get_ParaContentPosByXY = function(SearchPos, Depth, _CurLi
SearchPos.CurX = PrevSearchCurX + this.size.width; SearchPos.CurX = PrevSearchCurX + this.size.width;
return result; return result;
};
function CMathMatrix(props)
{
CMathMatrix.superclass.constructor.call(this);
this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_MATRIX;
this.Pr = new CMathMatrixPr();
this.spaceRow = null;
this.spaceColumn = null;
this.gaps = null;
this.column = 0;
this.setDefaultSpace();
if(props !== null && typeof(props) !== "undefined")
this.init(props);
g_oTableId.Add( this, this.Id );
}
Asc.extendClass(CMathMatrix, CMatrixBase);
CMathMatrix.prototype.init = function(props)
{
this.setProperties(props);
this.fillContent();
}
CMathMatrix.prototype.setPosition = function(pos, PosInfo)
{
this.pos.x = pos.x;
if(this.bInside === true)
this.pos.y = pos.y;
else
this.pos.y = pos.y - this.size.ascent; ///!!!!
var maxWH = this.getWidthsHeights();
var Widths = maxWH.widths;
var Heights = maxWH.heights;
var NewPos = new CMathPosition();
var h = 0, w = 0;
for(var i=0; i < this.nRow; i++)
{
w = 0;
for(var j = 0; j < this.nCol; j++)
{
var al = this.align(i, j);
NewPos.x = this.pos.x + this.GapLeft + al.x + w;
NewPos.y = this.pos.y + al.y + h;
this.elements[i][j].setPosition(NewPos, PosInfo);
w += Widths[j] + this.gaps.column[j];
}
h += Heights[i] + this.gaps.row[i];
}
} }
CMathMatrix.prototype.getMetrics = function(RPI) CMathMatrix.prototype.getMetrics = function(RPI)
{ {
...@@ -476,7 +558,7 @@ CMathMatrix.prototype.getMetrics = function(RPI) ...@@ -476,7 +558,7 @@ CMathMatrix.prototype.getMetrics = function(RPI)
} }
return {ascents: Ascents, descents: Descents, widths: Widths} return {ascents: Ascents, descents: Descents, widths: Widths}
} };
CMathMatrix.prototype.findDistance = function() // для получения позиции тагета CMathMatrix.prototype.findDistance = function() // для получения позиции тагета
{ {
var w = 0, h = 0; var w = 0, h = 0;
...@@ -493,15 +575,15 @@ CMathMatrix.prototype.setRowGapRule = function(rule, gap) ...@@ -493,15 +575,15 @@ CMathMatrix.prototype.setRowGapRule = function(rule, gap)
{ {
this.spaceRow.rule = rule; this.spaceRow.rule = rule;
this.spaceRow.gap = gap; this.spaceRow.gap = gap;
} };
CMathMatrix.prototype.setColumnGapRule = function(rule, gap, minGap) CMathMatrix.prototype.setColumnGapRule = function(rule, gap, minGap)
{ {
this.spaceColumn.rule = rule; this.spaceColumn.rule = rule;
this.spaceColumn.gap = gap; this.spaceColumn.gap = gap;
if(minGap !== null && typeof(minGap) !== "undefined") if(minGap !== null && typeof(minGap) !== "undefined")
this.spaceColumn.minGap = minGap; this.spaceColumn.minGap = minGap;
} };
CMathMatrix.prototype.getLineGap = function(txtPrp) /*CMathMatrix.prototype.getLineGap = function(txtPrp)
{ {
var spLine; var spLine;
...@@ -532,7 +614,7 @@ CMathMatrix.prototype.getLineGap = function(txtPrp) ...@@ -532,7 +614,7 @@ CMathMatrix.prototype.getLineGap = function(txtPrp)
//lineGap += this.params.font.metrics.Placeholder.Height; // для случая, когда gapRow - (аскент + дескент) > minGap, вычитаем из gap строки, а здесь прибавляем стандартный metrics.Height //lineGap += this.params.font.metrics.Placeholder.Height; // для случая, когда gapRow - (аскент + дескент) > minGap, вычитаем из gap строки, а здесь прибавляем стандартный metrics.Height
return lineGap; return lineGap;
} };
CMathMatrix.prototype.getRowSpace = function(txtPrp) CMathMatrix.prototype.getRowSpace = function(txtPrp)
{ {
var spLine; var spLine;
...@@ -562,11 +644,7 @@ CMathMatrix.prototype.getRowSpace = function(txtPrp) ...@@ -562,11 +644,7 @@ CMathMatrix.prototype.getRowSpace = function(txtPrp)
lineGap = Math.max(lineGap, min); lineGap = Math.max(lineGap, min);
return lineGap; return lineGap;
} };*/
CMathMatrix.prototype.baseJustification = function(type)
{
this.Pr.baseJc = type;
}
//// ////
CMathMatrix.prototype.setProperties = function(props) CMathMatrix.prototype.setProperties = function(props)
{ {
...@@ -574,13 +652,12 @@ CMathMatrix.prototype.setProperties = function(props) ...@@ -574,13 +652,12 @@ CMathMatrix.prototype.setProperties = function(props)
this.Pr.Set_FromObject(props); this.Pr.Set_FromObject(props);
this.column = this.Pr.Get_ColumnsCount(); this.column = this.Pr.Get_ColumnsCount();
} };
CMathMatrix.prototype.fillContent = function() CMathMatrix.prototype.fillContent = function()
{ {
this.setDimension(this.Pr.row, this.column); this.setDimension(this.Pr.row, this.column);
this.setContent(); this.setContent();
} };
CMathMatrix.prototype.getRowsCount = function() CMathMatrix.prototype.getRowsCount = function()
{ {
return this.Pr.row; return this.Pr.row;
...@@ -606,17 +683,17 @@ CMathMatrix.prototype.getPropsForWrite = function() ...@@ -606,17 +683,17 @@ CMathMatrix.prototype.getPropsForWrite = function()
props.rSp = this.spaceRow.gap; props.rSp = this.spaceRow.gap;
return props; return props;
} };
CMathMatrix.prototype.Save_Changes = function(Data, Writer) CMathMatrix.prototype.Save_Changes = function(Data, Writer)
{ {
Writer.WriteLong( historyitem_type_matrix ); Writer.WriteLong( historyitem_type_matrix );
} };
CMathMatrix.prototype.Load_Changes = function(Reader) CMathMatrix.prototype.Load_Changes = function(Reader)
{ {
} };
CMathMatrix.prototype.Refresh_RecalcData = function(Data) CMathMatrix.prototype.Refresh_RecalcData = function(Data)
{ {
} };
CMathMatrix.prototype.Write_ToBinary2 = function( Writer ) CMathMatrix.prototype.Write_ToBinary2 = function( Writer )
{ {
var nRowsCount = this.getRowsCount(); var nRowsCount = this.getRowsCount();
...@@ -645,7 +722,7 @@ CMathMatrix.prototype.Write_ToBinary2 = function( Writer ) ...@@ -645,7 +722,7 @@ CMathMatrix.prototype.Write_ToBinary2 = function( Writer )
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
this.Pr.Write_ToBinary(Writer); this.Pr.Write_ToBinary(Writer);
} };
CMathMatrix.prototype.Read_FromBinary2 = function( Reader ) CMathMatrix.prototype.Read_FromBinary2 = function( Reader )
{ {
// String : Id // String : Id
...@@ -675,11 +752,11 @@ CMathMatrix.prototype.Read_FromBinary2 = function( Reader ) ...@@ -675,11 +752,11 @@ CMathMatrix.prototype.Read_FromBinary2 = function( Reader )
this.Pr.Read_FromBinary(Reader); this.Pr.Read_FromBinary(Reader);
this.column = this.Pr.Get_ColumnsCount(); this.column = this.Pr.Get_ColumnsCount();
} };
CMathMatrix.prototype.Get_Id = function() CMathMatrix.prototype.Get_Id = function()
{ {
return this.Id; return this.Id;
} };
function CMathPoint() function CMathPoint()
{ {
...@@ -690,26 +767,20 @@ function CMathPoint() ...@@ -690,26 +767,20 @@ function CMathPoint()
//// ////
function CEqArray(props) function CEqArray(props)
{ {
CEqArray.superclass.constructor.call(this);
this.Id = g_oIdCounter.Get_NewId(); this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_EQ_ARRAY; this.kind = MATH_EQ_ARRAY;
this.Pr = this.Pr =
{ {
/* only for CEqArray*/
maxDist: 0, maxDist: 0,
objDist: 0, objDist: 0,
/**/
cGp: 0,
cGpRule: 0,
cSp: 0,
rSp: 0, rSp: 0,
rSpRule: 0, rSpRule: 0,
mcs: [], baseJc: BASEJC_CENTER
baseJc: BASEJC_CENTER,
plcHide: false
}; };
this.spaceRow = null; this.spaceRow = null;
...@@ -725,23 +796,26 @@ function CEqArray(props) ...@@ -725,23 +796,26 @@ function CEqArray(props)
// //
//// special for "read" //// //// special for "read" ////
this.column = 0; //this.column = 0;
//// ////
//CMathMatrix.call(this); //CMathMatrix.call(this);
// Делаем так, чтобы лишный Id в историю не записался // Делаем так, чтобы лишный Id в историю не записался
CMathMatrix.superclass.constructor.call(this);
//CMathMatrix.superclass.constructor.call(this);
if(props !== null && typeof(props) !== "undefined") if(props !== null && typeof(props) !== "undefined")
this.init(props); this.init(props);
g_oTableId.Add( this, this.Id ); g_oTableId.Add( this, this.Id );
} }
Asc.extendClass(CEqArray, CMathMatrix); Asc.extendClass(CEqArray, CMatrixBase);
CEqArray.prototype.init = function(props) CEqArray.prototype.init = function(props)
{ {
this.setProperties(props); this.setProperties(props);
this.fillContent(); this.setDimension(props.row, 1);
this.setContent();
} }
CEqArray.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize) CEqArray.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
{ {
...@@ -768,7 +842,7 @@ CEqArray.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize) ...@@ -768,7 +842,7 @@ CEqArray.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
//CEqArray.superclass.Resize.call(this, oMeasure, Parent, ParaMath, RPI, ArgSize); //CEqArray.superclass.Resize.call(this, oMeasure, Parent, ParaMath, RPI, ArgSize);
} }
CEqArray.prototype.getMetrics = function(RPI) CEqArray.prototype.getMetrics = function()
{ {
var AscentsMetrics = []; var AscentsMetrics = [];
var DescentsMetrics = []; var DescentsMetrics = [];
...@@ -914,13 +988,20 @@ CEqArray.prototype.setPosition = function(pos) ...@@ -914,13 +988,20 @@ CEqArray.prototype.setPosition = function(pos)
} }
CEqArray.prototype.setProperties = function(props) CEqArray.prototype.setProperties = function(props)
{ {
if(props.maxDist !== "undefined" && props.maxDist !== null) if(props.maxDist !== undefined && props.maxDist !== null)
this.Pr.maxDist = props.maxDist; this.Pr.maxDist = props.maxDist;
if(props.objDist !== "undefined" && props.objDist !== null) if(props.objDist !== undefined && props.objDist !== null)
this.Pr.objDist = props.objDist; this.Pr.objDist = props.objDist;
var mcs = []; if (undefined !== props.rSpRule && null !== props.rSpRule)
this.Pr.rSpRule = props.rSpRule;
if (undefined !== props.rSp && null !== props.rSp)
this.Pr.rSp = props.rSp;
/*var mcs = [];
mcs.push(new CMathMatrixColumnPr()); mcs.push(new CMathMatrixColumnPr());
var Pr = var Pr =
...@@ -935,7 +1016,7 @@ CEqArray.prototype.setProperties = function(props) ...@@ -935,7 +1016,7 @@ CEqArray.prototype.setProperties = function(props)
ctrPrp: props.ctrPrp ctrPrp: props.ctrPrp
}; };
CEqArray.superclass.setProperties.call(this, Pr); CEqArray.superclass.setProperties.call(this, Pr);*/
} }
CEqArray.prototype.getElement = function(num) CEqArray.prototype.getElement = function(num)
{ {
...@@ -944,7 +1025,8 @@ CEqArray.prototype.getElement = function(num) ...@@ -944,7 +1025,8 @@ CEqArray.prototype.getElement = function(num)
CEqArray.prototype.fillMathComposition = function(props, contents /*array*/) CEqArray.prototype.fillMathComposition = function(props, contents /*array*/)
{ {
this.setProperties(props); this.setProperties(props);
this.fillContent(); this.setDimension(this.nRow, this.nCol);
this.setContent();
for(var i = 0; i < this.nRow; i++) for(var i = 0; i < this.nRow; i++)
this.elements[i][0] = contents[i]; this.elements[i][0] = contents[i];
...@@ -1036,18 +1118,3 @@ CEqArray.prototype.Get_Id = function() ...@@ -1036,18 +1118,3 @@ CEqArray.prototype.Get_Id = function()
{ {
return this.Id; return this.Id;
} }
function TEST_MATH_JUCTIFICATION(mcJc)
{
MATH_MC_JC = mcJc;
editor.WordControl.m_oLogicDocument.Content[0].Content[0].Root.Resize(null, editor.WordControl.m_oLogicDocument.Content[0].Content[0] , g_oTextMeasurer);
var pos = new CMathPosition();
pos.x = 0;
pos.y = 0;
editor.WordControl.m_oLogicDocument.Content[0].Content[0].Root.setPosition(pos);
editor.WordControl.m_oLogicDocument.DrawingDocument.ClearCachePages();
editor.WordControl.m_oLogicDocument.DrawingDocument.FirePaint();
}
\ No newline at end of file
"use strict"; "use strict";
/*var SIGN_GAP = 0;
var RADICAL_GAP = 0.2513;
var RADICAL_H4 = 1.1715;
var RADICAL_H0 = 0;
var RADICAL_H1 = 0;
var RADICAL_H2 = 0;
var RADICAL_H3 = 0;
var RADICAL_H5 = 0;*/
/*var SIGN_GAP = 0.05;
var RADICAL_GAP = 0.1216;
var RADICAL_H4 = 1.2393;
var RADICAL_H0 = 0;
var RADICAL_H1 = 1.1588;
var RADICAL_H2 = 1.1673;
var RADICAL_H3 = 1.0232;
var RADICAL_H5 = 0;*/
//var SIGN_GAP = 0.05;
//var RADICAL_GAP = 0.1216;
//var GAP_TOP = 0.05;
//var SIGN_GAP = 0.1216;
//var GAP_TOP = 0.01822;
var GAP_TOP = 0.094492; var GAP_TOP = 0.094492;
var SIGN_GAP = 0.077108; var SIGN_GAP = 0.077108;
/*var RADICAL_H0 = 0;
var RADICAL_H1 = 0.1589;
var RADICAL_H2 = 0.1674;
var RADICAL_H3 = 0.038;
var RADICAL_H4 = 0.303;
var RADICAL_H5 = 0.2394;*/
var RADICAL_H0 = 1.2; var RADICAL_H0 = 1.2;
var RADICAL_H1 = 1.50732421875; var RADICAL_H1 = 1.50732421875;
var RADICAL_H2 = 2.8; var RADICAL_H2 = 2.8;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment