generateMohrCircle = function (s11, s22, s12) {
return [
{
id: "mohrCircle",
type: "circle",
cx: MC.cx,
cy: MC.cy,
r: MC.r,
fill: colors[1],
stroke: colors[0],
strokeWidth: 5,
fillOpacity: 0.75
},
{
id: "centerOfMohrCircle",
type: "circle",
cx: MC.cx,
cy: MC.cy,
r: pointR,
fill: "black"
},
{
id: "pointA",
type: "circle",
cx: xScale(sx),
cy: yScale(-1 * txy),
r: pointR,
fill: "black"
},
{
id: "pointAText",
type: "text",
x: xScale(sx),
y: yScale(-1 * txy) + 20,
text: `${sx}, -${txy}`
},
{
id: "pointB",
type: "circle",
cx: xScale(sy),
cy: yScale(txy),
r: pointR,
fill: "black"
},
{
id: "pointBText",
type: "text",
x: xScale(sy),
y: yScale(txy) - 20,
text: `${sy}, ${txy}`
},
{
id: "lineAB",
type: "line",
points: [
{ x: xScale(sx), y: yScale(-1 * txy) },
{ x: xScale(sy), y: yScale(txy) }
],
stroke: colors[0],
strokeWidth: 5
},
{
id: "lineAX",
type: "line",
points: [
{ x: xScale(sx), y: yScale(-1 * txy) },
{ x: xScale(sx), y: yScale(0) }
],
fill: "black",
lineType: "dashed"
},
{
id: "lineAY",
type: "line",
points: [
{ x: xScale(sx), y: yScale(-1 * txy) },
{ x: getYAxisX(), y: yScale(-1 * txy) } // Y axis is not always at 0 of X axis
],
fill: "black",
lineType: "dashed"
},
{
id: "lineBX",
type: "line",
points: [
{ x: xScale(sy), y: yScale(txy) },
{ x: xScale(sy), y: yScale(0) }
],
fill: "black",
lineType: "dashed"
},
{
id: "lineBY",
type: "line",
points: [
{ x: xScale(sy), y: yScale(txy) },
{ x: getYAxisX(), y: yScale(txy) } // Y axis is not always at 0 of X axis
],
fill: "black",
lineType: "dashed"
},
{
id: "pointC",
type: "circle",
cx: xScale(tss.sxp),
cy: yScale(-1 * tss.sxyp),
r: pointR,
fill: colors[4]
},
{
id: "pointCText",
type: "text",
x: xScale(tss.sxp),
y: yScale(-1 * tss.sxyp),
text: `${tss.sxp.toFixed(2)}, ${-1 * tss.sxyp.toFixed(2)}`
},
{
id: "pointD",
type: "circle",
cx: xScale(tss.syp),
cy: yScale(tss.sxyp),
r: pointR,
fill: colors[4]
},
{
id: "pointDText",
type: "text",
x: xScale(tss.syp),
y: yScale(tss.sxyp),
text: `${tss.syp.toFixed(2)}, ${tss.sxyp.toFixed(2)}`
},
{
id: "lineCD",
type: "line",
points: [
{ x: xScale(tss.sxp), y: yScale(-1 * tss.sxyp) },
{ x: xScale(tss.syp), y: yScale(tss.sxyp) }
],
stroke: colors[4],
strokeWidth: 5
},
{
id: "lineCX",
type: "line",
points: [
{ x: xScale(tss.sxp), y: yScale(-1 * tss.sxyp) },
{ x: xScale(tss.sxp), y: yScale(0) }
],
stroke: colors[4],
lineType: "dashed"
},
{
id: "lineCY",
type: "line",
points: [
{ x: xScale(tss.sxp), y: yScale(-1 * tss.sxyp) },
{ x: getYAxisX(), y: yScale(-1 * tss.sxyp) } // Y axis is not always at 0 of X axis
],
stroke: colors[4],
lineType: "dashed"
},
{
id: "lineDX",
type: "line",
points: [
{ x: xScale(tss.syp), y: yScale(tss.sxyp) },
{ x: xScale(tss.syp), y: yScale(0) }
],
stroke: colors[4],
lineType: "dashed"
},
{
id: "lineDY",
type: "line",
points: [
{ x: xScale(tss.syp), y: yScale(tss.sxyp) },
{ x: getYAxisX(), y: yScale(tss.sxyp) } // Y axis is not always at 0 of X axis
],
stroke: colors[4],
lineType: "dashed"
},
{
id: "pointP1",
type: "circle",
cx: xScale(s1),
cy: yScale(0),
r: pointR,
fill: colors[5]
},
{
id: "pointP2",
type: "circle",
cx: xScale(s2),
cy: yScale(0),
r: pointR,
fill: colors[5]
}
];
}