File: C:/xampp/htdocs/PSAproduction3/TVI-parsing13.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CRPC6-TR016 Production Report</title>
<style type="text/css">
<!--
body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #ffffff;
margin: 0; /* 比較好的做法是將 Body 元素的邊界與欄位間隔調整為零,以處理不同的瀏覽器預設值 */
padding: 0;
text-align: center; /* 這樣會讓容器在 IE 5* 瀏覽器內置中對齊。然後,文字會在 #container 選取器中設定為靠左對齊預設值 */
color: #000000;
}
.oneColElsCtr #container {
width: 46em;
background: #FFFFFF;
margin: 0 auto; /* 自動邊界 (搭配寬度) 會讓頁面置中對齊 */
border: 0px solid #000000;
text-align: left; /* 這樣做會覆寫 Body 元素上的 text-align: center。 */
}
.oneColElsCtr #mainContent {
padding: 0 20px; /* 請記住,欄位間隔就是 Div 方塊內部的空間,而邊界就是 Div 方塊外部的空間 */
}
-->
</style></head>
<body class="oneColElsCtr">
<?php
function get_betweenC ($text, $s1, $s2) {
$mid_url = "";
$pos_s = strrpos($text,$s1);
$pos_e = strpos($text,$s2);
for ( $i=$pos_s+strlen($s1) ; (( $i<($pos_e)) && $i < strlen($text)) ; $i++ ) {
$mid_url .= $text[$i];
}
return $mid_url;
}
function get_between ($text, $s1, $s2) {
$mid_url = "";
$pos_s = strrpos($text,$s1);
$pos_e = strrpos($text,$s2);
for ( $i=$pos_s+strlen($s1) ; (( $i<($pos_e)) && $i < strlen($text)) ; $i++ ) {
$mid_url .= $text[$i];
}
return $mid_url;
}
include 'sp38XYZ.php';
include 'spXYZ.php';
include 'lab2xyz.php';
include 'SCCA06.php';
include 'xyz2lab01.php';
include 'xyz2lab.php';
include 'dE00.php';
include 'DensityV.php';
include 'DensityV38.php';
//include 'DensityV.php';
$sum=260;
$check=1;
$dtime=time();
$dStr=substr($dtime,7,9)."-";
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo $target." Production Report! (for Type 1 paper, white backing)" . "<br />";
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
$filename=$dStr.$_FILES["file"]["name"];
//echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
// echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
if (file_exists("upload/" .$dStr. $_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"] . " already exists. ". "<br />";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],
"upload/" .$dStr. $_FILES["file"]["name"]);
echo "upload sucess! " . "<br />";
echo "Report start: " . "<br />";
// echo "Stored in: " . "upload/" . $_FILES["file"]["name"]. "<br />";
///parsing start
$contents = file("upload/".$dStr.$_FILES["file"]["name"]);
$stringC = implode($contents);
$fMark = strrpos($stringC,'i1Profiler');
//echo "fMark:".$fMark."<br>";
$fMarkC = strrpos($stringC,'ColorPort');
//echo "fMarkC:".$fMarkC."<br>";
if ($fMark>0) { /////////////////////////////////////////////////////////////////////////////////////////// i1 profiler go 572
$cols=get_betweenC($stringC,"NUMBER_OF_FIELDS",'BEGIN_DATA_FORMAT');
//echo "cols:".$cols."_zz<br>";
//echo $contents[20];
//echo $stringC;
$string = implode($contents);
$p = ereg_replace("\r\n?", "\n", $string);
$p = str_replace("\n", ',', $p);
//echo $p;
$datastring=get_between($p,"BEGIN_DATA,",",END_DATA");
$dot = explode("\t", $datastring);
//print_r ($dot);
echo "<br>";
$Pdot=0; //paper
//echo "take:".$dot[6+$cols*$Pdot];
$PX=sp38XYZ("X",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
$PY=sp38XYZ("Y",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
$PZ=sp38XYZ("Z",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
//echo "take PX:".$PX."_Y:".$PY."_Z:".$PZ;
$PL=xyz2lab01("l",$PX,$PY,$PZ);
$Pa=xyz2lab01("a",$PX,$PY,$PZ);
$Pb=xyz2lab01("b",$PX,$PY,$PZ);
//$depaper=sqrt(pow((95-$PL),2)+ pow((1-$Pa),2)+pow(((4)-$Pb),2));
if ($target=="Fogra39") {
echo "Fogra39 paper: L:95, a:0, b:-2<br />";}
elseif ($target=="CRPC6") {
echo "CRPC6 paper: L:95, a:1, b:-4<br />";}
echo "paper measured: L:".$PL.", a:".$Pa.", b:".$Pb. "<br />";
//echo "CRPC 6 Paper: 95 1 -4,<br> Cyan:56 -37 -50".", Magenta:48 75 -4".", Yellow:89 -4 93".", Black:16 0 0". "<br />";
if ($target=="Fogra39") {
$RPCCl=55;$RPCCa=-37;$RPCCb=-50;
$RPCMl=48;$RPCMa=74;$RPCMb=-3;
$RPCYl=89;$RPCYa=-5;$RPCYb=93;
$RPCKl=16;$RPCKa=0.01;$RPCKb=0.01;
$RPCC50l=75.62;$RPCC50a=-16.48;$RPCC50b=-26.70;
$RPCM50l=71.23;$RPCM50a=33.64;$RPCM50b=-7.40;
$RPCY50l=91.55;$RPCY50a=-4;$RPCY50b=41.00;
$RPCK50l=61.82;$RPCK50a=0.01;$RPCK50b=-1.16;
$RPCgl=58.04;$RPCga=0.26;$RPCgb=-1.13;
}
elseif ($target=="CRPC6") {
$RPCCl=56;$RPCCa=-37;$RPCCb=-50;
$RPCMl=48;$RPCMa=75;$RPCMb=-4;
$RPCYl=89;$RPCYa=-4;$RPCYb=93;
$RPCKl=16;$RPCKa=0.01;$RPCKb=0.01;
$RPCC50l=75.14;$RPCC50a=-16.63;$RPCC50b=-27.88;
$RPCM50l=70.07;$RPCM50a=35.98;$RPCM50b=-7.49;
$RPCY50l=91.49;$RPCY50a=-2.75;$RPCY50b=41.34;
$RPCK50l=60.4;$RPCK50a=0.46;$RPCK50b=-2.59;
$RPCgl=57.46;$RPCga=0.38;$RPCgb=-2.03;
}
$Xp=$PX*100;
$Yp=$PY*100;
$Zp=$PZ*100;
//////////////////////////////////////////////////////////////CCCCCCCC
$RPCCX=lab2xyz("x",$RPCCl,$RPCCa,$RPCCb);
$RPCCY=lab2xyz("y",$RPCCl,$RPCCa,$RPCCb);
$RPCCZ=lab2xyz("z",$RPCCl,$RPCCa,$RPCCb);
$scCX=SCCA06("x",$RPCCX,$Xp);
$scCY=SCCA06("y",$RPCCY,$Yp);
$scCZ=SCCA06("z",$RPCCZ,$Zp);
$scCL=xyz2lab("l",$scCX,$scCY,$scCZ);
$scCa=xyz2lab("a",$scCX,$scCY,$scCZ);
$scCb=xyz2lab("b",$scCX,$scCY,$scCZ);
$RPCC50X=lab2xyz("x",$RPCC50l,$RPCC50a,$RPCC50b);
$RPCC50Y=lab2xyz("y",$RPCC50l,$RPCC50a,$RPCC50b);
$RPCC50Z=lab2xyz("z",$RPCC50l,$RPCC50a,$RPCC50b);
$scC50X=SCCA06("x",$RPCC50X,$Xp);
$scC50Y=SCCA06("y",$RPCC50Y,$Yp);
$scC50Z=SCCA06("z",$RPCC50Z,$Zp);
$scC50L=xyz2lab("l",$scC50X,$scC50Y,$scC50Z);
$scC50a=xyz2lab("a",$scC50X,$scC50Y,$scC50Z);
$scC50b=xyz2lab("b",$scC50X,$scC50Y,$scC50Z);
/////////////////////////////////////////////////////////////
$RPCMX=lab2xyz("x",$RPCMl,$RPCMa,$RPCMb);
$RPCMY=lab2xyz("y",$RPCMl,$RPCMa,$RPCMb);
$RPCMZ=lab2xyz("z",$RPCMl,$RPCMa,$RPCMb);
$scMX=SCCA06("x",$RPCMX,$Xp);
$scMY=SCCA06("y",$RPCMY,$Yp);
$scMZ=SCCA06("z",$RPCMZ,$Zp);
$scML=xyz2lab("l",$scMX,$scMY,$scMZ);
$scMa=xyz2lab("a",$scMX,$scMY,$scMZ);
$scMb=xyz2lab("b",$scMX,$scMY,$scMZ);
$RPCM50X=lab2xyz("x",$RPCM50l,$RPCM50a,$RPCM50b);
$RPCM50Y=lab2xyz("y",$RPCM50l,$RPCM50a,$RPCM50b);
$RPCM50Z=lab2xyz("z",$RPCM50l,$RPCM50a,$RPCM50b);
$scM50X=SCCA06("x",$RPCM50X,$Xp);
$scM50Y=SCCA06("y",$RPCM50Y,$Yp);
$scM50Z=SCCA06("z",$RPCM50Z,$Zp);
$scM50L=xyz2lab("l",$scM50X,$scM50Y,$scM50Z);
$scM50a=xyz2lab("a",$scM50X,$scM50Y,$scM50Z);
$scM50b=xyz2lab("b",$scM50X,$scM50Y,$scM50Z);
////////////////////////////////////////////////////////////////
$RPCYX=lab2xyz("x",$RPCYl,$RPCYa,$RPCYb);
$RPCYY=lab2xyz("y",$RPCYl,$RPCYa,$RPCYb);
$RPCYZ=lab2xyz("z",$RPCYl,$RPCYa,$RPCYb);
$scYX=SCCA06("x",$RPCYX,$Xp);
$scYY=SCCA06("y",$RPCYY,$Yp);
$scYZ=SCCA06("z",$RPCYZ,$Zp);
$scYL=xyz2lab("l",$scYX,$scYY,$scYZ);
$scYa=xyz2lab("a",$scYX,$scYY,$scYZ);
$scYb=xyz2lab("b",$scYX,$scYY,$scYZ);
$RPCY50X=lab2xyz("x",$RPCY50l,$RPCY50a,$RPCY50b);
$RPCY50Y=lab2xyz("y",$RPCY50l,$RPCY50a,$RPCY50b);
$RPCY50Z=lab2xyz("z",$RPCY50l,$RPCY50a,$RPCY50b);
$scY50X=SCCA06("x",$RPCY50X,$Xp);
$scY50Y=SCCA06("y",$RPCY50Y,$Yp);
$scY50Z=SCCA06("z",$RPCY50Z,$Zp);
$scY50L=xyz2lab("l",$scY50X,$scY50Y,$scY50Z);
$scY50a=xyz2lab("a",$scY50X,$scY50Y,$scY50Z);
$scY50b=xyz2lab("b",$scY50X,$scY50Y,$scY50Z);
////////////////////////////////////////////////////////////////////
$RPCKX=lab2xyz("x",$RPCKl,$RPCKa,$RPCKb);
$RPCKY=lab2xyz("y",$RPCKl,$RPCKa,$RPCKb);
$RPCKZ=lab2xyz("z",$RPCKl,$RPCKa,$RPCKb);
$scKX=SCCA06("x",$RPCKX,$Xp);
$scKY=SCCA06("y",$RPCKY,$Yp);
$scKZ=SCCA06("z",$RPCKZ,$Zp);
$scKL=xyz2lab("l",$scKX,$scKY,$scKZ);
$scKa=xyz2lab("a",$scKX,$scKY,$scKZ);
$scKb=xyz2lab("b",$scKX,$scKY,$scKZ);
$RPCK50X=lab2xyz("x",$RPCK50l,$RPCK50a,$RPCK50b);
$RPCK50Y=lab2xyz("y",$RPCK50l,$RPCK50a,$RPCK50b);
$RPCK50Z=lab2xyz("z",$RPCK50l,$RPCK50a,$RPCK50b);
$scK50X=SCCA06("x",$RPCK50X,$Xp);
$scK50Y=SCCA06("y",$RPCK50Y,$Yp);
$scK50Z=SCCA06("z",$RPCK50Z,$Zp);
$scK50L=xyz2lab("l",$scK50X,$scK50Y,$scK50Z);
$scK50a=xyz2lab("a",$scK50X,$scK50Y,$scK50Z);
$scK50b=xyz2lab("b",$scK50X,$scK50Y,$scK50Z);
/////////////////////////////////////////////////////gray
$RPCgX=lab2xyz("x",$RPCgl,$RPCga,$RPCgb);
$RPCgY=lab2xyz("y",$RPCgl,$RPCga,$RPCgb);
$RPCgZ=lab2xyz("z",$RPCgl,$RPCga,$RPCgb);
$scgX=SCCA06("x",$RPCgX,$Xp);
$scgY=SCCA06("y",$RPCgY,$Yp);
$scgZ=SCCA06("z",$RPCgZ,$Zp);
$scgL=xyz2lab("l",$scgX,$scgY,$scgZ);
$scga=xyz2lab("a",$scgX,$scgY,$scgZ);
$scgb=xyz2lab("b",$scgX,$scgY,$scgZ);
//echo "CRPC 6 SCCA <br> Cyan L:".round($scCL,2)." a:".round($scCa,2)." b:".round($scCb,2)."<br>Magenta L:".round($scML,2)." a:".round($scMa,2)." b:".round($scMb,2)."<br>Yellow L:".round($scYL,2)." a:".round($scYa,2)." b:".round($scYb,2)."<br>Black L:".round($scKL,2)." a:".round($scKa,2)." b:".round($scKb,2). "<br />";
//////////////////////////////mc///////////////////////////////////////////////////////////
for ($s=1; $s<=20; $s+=1) {///////
$Pdot=4+10*($s-1);
//$Pdot=4;////////////////////////////////K100
${'mk'.$s.'x'}=sp38XYZ("X",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mk'.$s.'y'}=sp38XYZ("Y",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mk'.$s.'z'}=sp38XYZ("Z",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mk'.$s.'l'}=xyz2lab01("l",${'mk'.$s.'x'},${'mk'.$s.'y'},${'mk'.$s.'z'});
${'mk'.$s.'a'}=xyz2lab01("a",${'mk'.$s.'x'},${'mk'.$s.'y'},${'mk'.$s.'z'});
${'mk'.$s.'b'}=xyz2lab01("b",${'mk'.$s.'x'},${'mk'.$s.'y'},${'mk'.$s.'z'});
${'mk'.$s.'D'}=DensitySp38("K",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
$Pdot=8+10*($s-1);;////////////////////////////K50
//$Pdot=8;////////////////////////////////K50
${'mk50'.$s.'x'}=sp38XYZ("X",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mk50'.$s.'y'}=sp38XYZ("Y",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mk50'.$s.'z'}=sp38XYZ("Z",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mk50'.$s.'l'}=xyz2lab01("l",${'mk50'.$s.'x'},${'mk50'.$s.'y'},${'mk50'.$s.'z'});
${'mk50'.$s.'a'}=xyz2lab01("a",${'mk50'.$s.'x'},${'mk50'.$s.'y'},${'mk50'.$s.'z'});
${'mk50'.$s.'b'}=xyz2lab01("b",${'mk50'.$s.'x'},${'mk50'.$s.'y'},${'mk50'.$s.'z'});
${'mk50'.$s.'D'}=DensitySp38("K",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'TVIk'.$s}=((($PX-0.55*$PZ)-(${'mk50'.$s.'x'}-0.55*${'mk50'.$s.'z'}))/(($PX-0.55*$PZ)-(${'mk'.$s.'x'}-0.55*${'mk'.$s.'z'})))*100;
//echo "tvi;".${'TVIk'.$s}."xx";
////////////////////////////////sec c
$Pdot=1+10*($s-1);///////////////////////////////////////////////C100
${'mc'.$s.'x'}=sp38XYZ("X",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mc'.$s.'y'}=sp38XYZ("Y",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mc'.$s.'z'}=sp38XYZ("Z",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mc'.$s.'l'}=xyz2lab01("l",${'mc'.$s.'x'},${'mc'.$s.'y'},${'mc'.$s.'z'});
${'mc'.$s.'a'}=xyz2lab01("a",${'mc'.$s.'x'},${'mc'.$s.'y'},${'mc'.$s.'z'});
${'mc'.$s.'b'}=xyz2lab01("b",${'mc'.$s.'x'},${'mc'.$s.'y'},${'mc'.$s.'z'});
${'mc'.$s.'D'}=DensitySp38("C",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
$Pdot=5+10*($s-1);//////////////////////////////////////////////C50
${'mc50'.$s.'x'}=sp38XYZ("X",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mc50'.$s.'y'}=sp38XYZ("Y",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mc50'.$s.'z'}=sp38XYZ("Z",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mc50'.$s.'l'}=xyz2lab01("l",${'mc50'.$s.'x'},${'mc50'.$s.'y'},${'mc50'.$s.'z'});
${'mc50'.$s.'a'}=xyz2lab01("a",${'mc50'.$s.'x'},${'mc50'.$s.'y'},${'mc50'.$s.'z'});
${'mc50'.$s.'b'}=xyz2lab01("b",${'mc50'.$s.'x'},${'mc50'.$s.'y'},${'mc50'.$s.'z'});
${'mc50'.$s.'D'}=DensitySp38("C",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'TVIc'.$s}=((($PX-0.55*$PZ)-(${'mc50'.$s.'x'}-0.55*${'mc50'.$s.'z'}))/(($PX-0.55*$PZ)-(${'mc'.$s.'x'}-0.55*${'mc'.$s.'z'})))*100;
///////////////////////////////////////////////////////////////sec M
$Pdot=2+10*($s-1);////////////////////M100
${'mm'.$s.'x'}=sp38XYZ("X",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mm'.$s.'y'}=sp38XYZ("Y",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mm'.$s.'z'}=sp38XYZ("Z",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mm'.$s.'l'}=xyz2lab01("l",${'mm'.$s.'x'},${'mm'.$s.'y'},${'mm'.$s.'z'});
${'mm'.$s.'a'}=xyz2lab01("a",${'mm'.$s.'x'},${'mm'.$s.'y'},${'mm'.$s.'z'});
${'mm'.$s.'b'}=xyz2lab01("b",${'mm'.$s.'x'},${'mm'.$s.'y'},${'mm'.$s.'z'});
${'mm'.$s.'D'}=DensitySp38("M",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
$Pdot=6+10*($s-1);////////////////////M50
${'mm50'.$s.'x'}=sp38XYZ("X",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mm50'.$s.'y'}=sp38XYZ("Y",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mm50'.$s.'z'}=sp38XYZ("Z",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mm50'.$s.'l'}=xyz2lab01("l",${'mm50'.$s.'x'},${'mm50'.$s.'y'},${'mm50'.$s.'z'});
${'mm50'.$s.'a'}=xyz2lab01("a",${'mm50'.$s.'x'},${'mm50'.$s.'y'},${'mm50'.$s.'z'});
${'mm50'.$s.'b'}=xyz2lab01("b",${'mm50'.$s.'x'},${'mm50'.$s.'y'},${'mm50'.$s.'z'});
${'mm50'.$s.'D'}=DensitySp38("M",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'TVIm'.$s}=((($PX-0.55*$PZ)-(${'mm50'.$s.'x'}-0.55*${'mm50'.$s.'z'}))/(($PX-0.55*$PZ)-(${'mm'.$s.'x'}-0.55*${'mm'.$s.'z'})))*100;
////////////////////////////////////sec Y
$Pdot=3+10*($s-1);///////////////////////////////////////Y100
${'my'.$s.'x'}=sp38XYZ("X",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'my'.$s.'y'}=sp38XYZ("Y",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'my'.$s.'z'}=sp38XYZ("Z",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'my'.$s.'l'}=xyz2lab01("l",${'my'.$s.'x'},${'my'.$s.'y'},${'my'.$s.'z'});
${'my'.$s.'a'}=xyz2lab01("a",${'my'.$s.'x'},${'my'.$s.'y'},${'my'.$s.'z'});
${'my'.$s.'b'}=xyz2lab01("b",${'my'.$s.'x'},${'my'.$s.'y'},${'my'.$s.'z'});
${'my'.$s.'D'}=DensitySp38("Y",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
$Pdot=7+10*($s-1);///////////////////////////////////////Y50
${'my50'.$s.'x'}=sp38XYZ("X",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'my50'.$s.'y'}=sp38XYZ("Y",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'my50'.$s.'z'}=sp38XYZ("Z",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'my50'.$s.'l'}=xyz2lab01("l",${'my50'.$s.'x'},${'my50'.$s.'y'},${'my50'.$s.'z'});
${'my50'.$s.'a'}=xyz2lab01("a",${'my50'.$s.'x'},${'my50'.$s.'y'},${'my50'.$s.'z'});
${'my50'.$s.'b'}=xyz2lab01("b",${'my50'.$s.'x'},${'my50'.$s.'y'},${'my50'.$s.'z'});
${'my50'.$s.'D'}=DensitySp38("Y",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'TVIy'.$s}=((($PX-0.55*$PZ)-(${'my50'.$s.'x'}-0.55*${'my50'.$s.'z'}))/(($PX-0.55*$PZ)-(${'my'.$s.'x'}-0.55*${'my'.$s.'z'})))*100;
$Pdot=9+10*($s-1);///////////////////////////////////////Gray
${'mg'.$s.'x'}=sp38XYZ("X",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mg'.$s.'y'}=sp38XYZ("Y",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mg'.$s.'z'}=sp38XYZ("Z",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
${'mg'.$s.'l'}=xyz2lab01("l",${'mg'.$s.'x'},${'mg'.$s.'y'},${'mg'.$s.'z'});
${'mg'.$s.'a'}=xyz2lab01("a",${'mg'.$s.'x'},${'mg'.$s.'y'},${'mg'.$s.'z'});
${'mg'.$s.'b'}=xyz2lab01("b",${'mg'.$s.'x'},${'mg'.$s.'y'},${'mg'.$s.'z'});
${'mg'.$s.'D'}=DensitySp38("K",$dot[6+$cols*$Pdot],$dot[6+$cols*$Pdot+1],$dot[6+$cols*$Pdot+2],$dot[6+$cols*$Pdot+3],$dot[6+$cols*$Pdot+4],$dot[6+$cols*$Pdot+5],$dot[6+$cols*$Pdot+6],$dot[6+$cols*$Pdot+7],$dot[6+$cols*$Pdot+8],$dot[6+$cols*$Pdot+9],$dot[6+$cols*$Pdot+10],$dot[6+$cols*$Pdot+11],$dot[6+$cols*$Pdot+12],$dot[6+$cols*$Pdot+13],$dot[6+$cols*$Pdot+14],$dot[6+$cols*$Pdot+15],$dot[6+$cols*$Pdot+16],$dot[6+$cols*$Pdot+17],$dot[6+$cols*$Pdot+18],$dot[6+$cols*$Pdot+19],$dot[6+$cols*$Pdot+20],$dot[6+$cols*$Pdot+21],$dot[6+$cols*$Pdot+22],$dot[6+$cols*$Pdot+23],$dot[6+$cols*$Pdot+24],$dot[6+$cols*$Pdot+25],$dot[6+$cols*$Pdot+26],$dot[6+$cols*$Pdot+27],$dot[6+$cols*$Pdot+28],$dot[6+$cols*$Pdot+29],$dot[6+$cols*$Pdot+30],$dot[6+$cols*$Pdot+31],$dot[6+$cols*$Pdot+32],$dot[6+$cols*$Pdot+33],$dot[6+$cols*$Pdot+34],$dot[6+$cols*$Pdot+35]);
}///
$dec=de00($RPCCl,$RPCCa,$RPCCb,$mcl,$mca,$mcb);
$dem=de00($RPCMl,$RPCMa,$RPCMb,$mml,$mma,$mmb);
$dey=de00($RPCYl,$RPCYa,$RPCYb,$myl,$mya,$myb);
$dek=de00($RPCKl,$RPCKa,$RPCKb,$mkl,$mka,$mkb);
$dec50=de00($RPCC50l,$RPCC50a,$RPCC50b,$mc50l,$mc50a,$mc50b);
$dem50=de00($RPCM50l,$RPCM50a,$RPCM50b,$mm50l,$mm50a,$mm50b);
$dey50=de00($RPCY50l,$RPCY50a,$RPCY50b,$my50l,$my50a,$my50b);
$dek50=de00($RPCK50l,$RPCK50a,$RPCK50b,$mk50l,$mk50a,$mk50b);
$deg=de00($RPCgl,$RPCga,$RPCgb,$mgl,$mga,$mgb);
?>
<?php
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
if ($fMarkC>0) { ////////////////////////////////////////////////////////////// ColorPort 400
$cols=get_betweenC($stringC,"NUMBER_OF_FIELDS",'WEIGHTING_FUNCTION ');
//echo "cols:".$cols."_zz<br>";
//echo $contents[20];
//echo $stringC;
$string = implode($contents);
$p = ereg_replace("\r\n?", "\n", $string);
$p = str_replace("\n", ',', $p);
//echo $p;
$datastring=get_between($p,"BEGIN_DATA,",",END_DATA");
$dot = explode("\t", $datastring);
//print_r ($dot);
echo "<br>";
$Pdot=0;///paper line
//echo "take:".$dot[9+$cols*$Pdot-$Pdot];
/////380-730 paper
$PX=sp38XYZ("X",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
$PY=sp38XYZ("Y",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
$PZ=sp38XYZ("Z",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
//echo "take PX:".$PX."_Y:".$PY."_Z:".$PZ;
$PL=xyz2lab01("l",$PX,$PY,$PZ);
$Pa=xyz2lab01("a",$PX,$PY,$PZ);
$Pb=xyz2lab01("b",$PX,$PY,$PZ);
//$depaper=sqrt(pow((95-$PL),2)+ pow((1-$Pa),2)+pow(((4)-$Pb),2));
echo "CRPC6 paper: L:95, a:1, b:-4<br />";
echo "paper measured: L:".$PL.", a:".$Pa.", b:".$Pb. "<br />";
//echo "CRPC 6 Paper: 95 1 -4,<br> Cyan:56 -37 -50".", Magenta:48 75 -4".", Yellow:89 -4 93".", Black:16 0 0". "<br />";
$RPCCl=56;$RPCCa=-37;$RPCCb=-50;
$RPCMl=48;$RPCMa=75;$RPCMb=-4;
$RPCYl=89;$RPCYa=-4;$RPCYb=93;
$RPCKl=16;$RPCKa=0.01;$RPCKb=0.01;
$RPCC50l=75.14;$RPCC50a=-16.63;$RPCC50b=-27.88;
$RPCM50l=70.07;$RPCM50a=35.98;$RPCM50b=-7.49;
$RPCY50l=91.49;$RPCY50a=-2.75;$RPCY50b=41.34;
$RPCK50l=60.4;$RPCK50a=0.46;$RPCK50b=-2.59;
$RPCgl=57.46;$RPCga=0.38;$RPCgb=-2.03;
$Xp=$PX*100;
$Yp=$PY*100;
$Zp=$PZ*100;
//////////////////////////////////////////////////////////////
$RPCCX=lab2xyz("x",$RPCCl,$RPCCa,$RPCCb);
$RPCCY=lab2xyz("y",$RPCCl,$RPCCa,$RPCCb);
$RPCCZ=lab2xyz("z",$RPCCl,$RPCCa,$RPCCb);
$scCX=SCCA06("x",$RPCCX,$Xp);
$scCY=SCCA06("y",$RPCCY,$Yp);
$scCZ=SCCA06("z",$RPCCZ,$Zp);
$scCL=xyz2lab("l",$scCX,$scCY,$scCZ);
$scCa=xyz2lab("a",$scCX,$scCY,$scCZ);
$scCb=xyz2lab("b",$scCX,$scCY,$scCZ);
$RPCC50X=lab2xyz("x",$RPCC50l,$RPCC50a,$RPCC50b);
$RPCC50Y=lab2xyz("y",$RPCC50l,$RPCC50a,$RPCC50b);
$RPCC50Z=lab2xyz("z",$RPCC50l,$RPCC50a,$RPCC50b);
$scC50X=SCCA06("x",$RPCC50X,$Xp);
$scC50Y=SCCA06("y",$RPCC50Y,$Yp);
$scC50Z=SCCA06("z",$RPCC50Z,$Zp);
$scC50L=xyz2lab("l",$scC50X,$scC50Y,$scC50Z);
$scC50a=xyz2lab("a",$scC50X,$scC50Y,$scC50Z);
$scC50b=xyz2lab("b",$scC50X,$scC50Y,$scC50Z);
/////////////////////////////////////////////////////////////
$RPCMX=lab2xyz("x",$RPCMl,$RPCMa,$RPCMb);
$RPCMY=lab2xyz("y",$RPCMl,$RPCMa,$RPCMb);
$RPCMZ=lab2xyz("z",$RPCMl,$RPCMa,$RPCMb);
$scMX=SCCA06("x",$RPCMX,$Xp);
$scMY=SCCA06("y",$RPCMY,$Yp);
$scMZ=SCCA06("z",$RPCMZ,$Zp);
$scML=xyz2lab("l",$scMX,$scMY,$scMZ);
$scMa=xyz2lab("a",$scMX,$scMY,$scMZ);
$scMb=xyz2lab("b",$scMX,$scMY,$scMZ);
$RPCM50X=lab2xyz("x",$RPCM50l,$RPCM50a,$RPCM50b);
$RPCM50Y=lab2xyz("y",$RPCM50l,$RPCM50a,$RPCM50b);
$RPCM50Z=lab2xyz("z",$RPCM50l,$RPCM50a,$RPCM50b);
$scM50X=SCCA06("x",$RPCM50X,$Xp);
$scM50Y=SCCA06("y",$RPCM50Y,$Yp);
$scM50Z=SCCA06("z",$RPCM50Z,$Zp);
$scM50L=xyz2lab("l",$scM50X,$scM50Y,$scM50Z);
$scM50a=xyz2lab("a",$scM50X,$scM50Y,$scM50Z);
$scM50b=xyz2lab("b",$scM50X,$scM50Y,$scM50Z);
////////////////////////////////////////////////////////////////
$RPCYX=lab2xyz("x",$RPCYl,$RPCYa,$RPCYb);
$RPCYY=lab2xyz("y",$RPCYl,$RPCYa,$RPCYb);
$RPCYZ=lab2xyz("z",$RPCYl,$RPCYa,$RPCYb);
$scYX=SCCA06("x",$RPCYX,$Xp);
$scYY=SCCA06("y",$RPCYY,$Yp);
$scYZ=SCCA06("z",$RPCYZ,$Zp);
$scYL=xyz2lab("l",$scYX,$scYY,$scYZ);
$scYa=xyz2lab("a",$scYX,$scYY,$scYZ);
$scYb=xyz2lab("b",$scYX,$scYY,$scYZ);
$RPCY50X=lab2xyz("x",$RPCY50l,$RPCY50a,$RPCY50b);
$RPCY50Y=lab2xyz("y",$RPCY50l,$RPCY50a,$RPCY50b);
$RPCY50Z=lab2xyz("z",$RPCY50l,$RPCY50a,$RPCY50b);
$scY50X=SCCA06("x",$RPCY50X,$Xp);
$scY50Y=SCCA06("y",$RPCY50Y,$Yp);
$scY50Z=SCCA06("z",$RPCY50Z,$Zp);
$scY50L=xyz2lab("l",$scY50X,$scY50Y,$scY50Z);
$scY50a=xyz2lab("a",$scY50X,$scY50Y,$scY50Z);
$scY50b=xyz2lab("b",$scY50X,$scY50Y,$scY50Z);
////////////////////////////////////////////////////////////////////
$RPCKX=lab2xyz("x",$RPCKl,$RPCKa,$RPCKb);
$RPCKY=lab2xyz("y",$RPCKl,$RPCKa,$RPCKb);
$RPCKZ=lab2xyz("z",$RPCKl,$RPCKa,$RPCKb);
$scKX=SCCA06("x",$RPCKX,$Xp);
$scKY=SCCA06("y",$RPCKY,$Yp);
$scKZ=SCCA06("z",$RPCKZ,$Zp);
$scKL=xyz2lab("l",$scKX,$scKY,$scKZ);
$scKa=xyz2lab("a",$scKX,$scKY,$scKZ);
$scKb=xyz2lab("b",$scKX,$scKY,$scKZ);
$RPCK50X=lab2xyz("x",$RPCK50l,$RPCK50a,$RPCK50b);
$RPCK50Y=lab2xyz("y",$RPCK50l,$RPCK50a,$RPCK50b);
$RPCK50Z=lab2xyz("z",$RPCK50l,$RPCK50a,$RPCK50b);
$scK50X=SCCA06("x",$RPCK50X,$Xp);
$scK50Y=SCCA06("y",$RPCK50Y,$Yp);
$scK50Z=SCCA06("z",$RPCK50Z,$Zp);
$scK50L=xyz2lab("l",$scK50X,$scK50Y,$scK50Z);
$scK50a=xyz2lab("a",$scK50X,$scK50Y,$scK50Z);
$scK50b=xyz2lab("b",$scK50X,$scK50Y,$scK50Z);
/////////////////////////////////////////////////////gray
$RPCgX=lab2xyz("x",$RPCgl,$RPCga,$RPCgb);
$RPCgY=lab2xyz("y",$RPCgl,$RPCga,$RPCgb);
$RPCgZ=lab2xyz("z",$RPCgl,$RPCga,$RPCgb);
$scgX=SCCA06("x",$RPCgX,$Xp);
$scgY=SCCA06("y",$RPCgY,$Yp);
$scgZ=SCCA06("z",$RPCgZ,$Zp);
$scgL=xyz2lab("l",$scgX,$scgY,$scgZ);
$scga=xyz2lab("a",$scgX,$scgY,$scgZ);
$scgb=xyz2lab("b",$scgX,$scgY,$scgZ);
echo "CRPC 6 SCCA <br> Cyan L:".round($scCL,2)." a:".round($scCa,2)." b:".round($scCb,2)."<br>Magenta L:".round($scML,2)." a:".round($scMa,2)." b:".round($scMb,2)."<br>Yellow L:".round($scYL,2)." a:".round($scYa,2)." b:".round($scYb,2)."<br>Black L:".round($scKL,2)." a:".round($scKa,2)." b:".round($scKb,2). "<br />";
?>
<p><p>
<?php
//////////////////////////////////////////////////Fogra Media Check
$psum=20;
// $pl=95; $pa=-0.01;$pb=-2;
for ($s=1; $s<=20; $s+=1) {///////
$Pdot=4+10*($s-1);
//$Pdot=4;////////////////////////////////K100
${'mk'.$s.'x'}=sp38XYZ("X",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mk'.$s.'y'}=sp38XYZ("Y",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mk'.$s.'z'}=sp38XYZ("Z",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mk'.$s.'l'}=xyz2lab01("l",${'mk'.$s.'x'},${'mk'.$s.'y'},${'mk'.$s.'z'});
${'mk'.$s.'a'}=xyz2lab01("a",${'mk'.$s.'x'},${'mk'.$s.'y'},${'mk'.$s.'z'});
${'mk'.$s.'b'}=xyz2lab01("b",${'mk'.$s.'x'},${'mk'.$s.'y'},${'mk'.$s.'z'});
${'mk'.$s.'D'}=DensitySp38("K",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
$Pdot=8+10*($s-1);;////////////////////////////K50
//$Pdot=8;////////////////////////////////K50
${'mk50'.$s.'x'}=sp38XYZ("X",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mk50'.$s.'y'}=sp38XYZ("Y",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mk50'.$s.'z'}=sp38XYZ("Z",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mk50'.$s.'l'}=xyz2lab01("l",${'mk50'.$s.'x'},${'mk50'.$s.'y'},${'mk50'.$s.'z'});
${'mk50'.$s.'a'}=xyz2lab01("a",${'mk50'.$s.'x'},${'mk50'.$s.'y'},${'mk50'.$s.'z'});
${'mk50'.$s.'b'}=xyz2lab01("b",${'mk50'.$s.'x'},${'mk50'.$s.'y'},${'mk50'.$s.'z'});
${'mk50'.$s.'D'}=DensitySp38("K",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'TVIk'.$s}=((($PX-0.55*$PZ)-(${'mk50'.$s.'x'}-0.55*${'mk50'.$s.'z'}))/(($PX-0.55*$PZ)-(${'mk'.$s.'x'}-0.55*${'mk'.$s.'z'})))*100;
//echo "tvi;".${'TVIk'.$s}."xx";
////////////////////////////////sec c
$Pdot=1+10*($s-1);///////////////////////////////////////////////C100
${'mc'.$s.'x'}=sp38XYZ("X",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mc'.$s.'y'}=sp38XYZ("Y",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mc'.$s.'z'}=sp38XYZ("Z",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mc'.$s.'l'}=xyz2lab01("l",${'mc'.$s.'x'},${'mc'.$s.'y'},${'mc'.$s.'z'});
${'mc'.$s.'a'}=xyz2lab01("a",${'mc'.$s.'x'},${'mc'.$s.'y'},${'mc'.$s.'z'});
${'mc'.$s.'b'}=xyz2lab01("b",${'mc'.$s.'x'},${'mc'.$s.'y'},${'mc'.$s.'z'});
${'mc'.$s.'D'}=DensitySp38("C",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
$Pdot=5+10*($s-1);//////////////////////////////////////////////C50
${'mc50'.$s.'x'}=sp38XYZ("X",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mc50'.$s.'y'}=sp38XYZ("Y",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mc50'.$s.'z'}=sp38XYZ("Z",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mc50'.$s.'l'}=xyz2lab01("l",${'mc50'.$s.'x'},${'mc50'.$s.'y'},${'mc50'.$s.'z'});
${'mc50'.$s.'a'}=xyz2lab01("a",${'mc50'.$s.'x'},${'mc50'.$s.'y'},${'mc50'.$s.'z'});
${'mc50'.$s.'b'}=xyz2lab01("b",${'mc50'.$s.'x'},${'mc50'.$s.'y'},${'mc50'.$s.'z'});
${'mc50'.$s.'D'}=DensitySp38("C",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'TVIc'.$s}=((($PX-0.55*$PZ)-(${'mc50'.$s.'x'}-0.55*${'mc50'.$s.'z'}))/(($PX-0.55*$PZ)-(${'mc'.$s.'x'}-0.55*${'mc'.$s.'z'})))*100;
///////////////////////////////////////////////////////////////sec M
$Pdot=2+10*($s-1);////////////////////M100
${'mm'.$s.'x'}=sp38XYZ("X",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mm'.$s.'y'}=sp38XYZ("Y",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mm'.$s.'z'}=sp38XYZ("Z",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mm'.$s.'l'}=xyz2lab01("l",${'mm'.$s.'x'},${'mm'.$s.'y'},${'mm'.$s.'z'});
${'mm'.$s.'a'}=xyz2lab01("a",${'mm'.$s.'x'},${'mm'.$s.'y'},${'mm'.$s.'z'});
${'mm'.$s.'b'}=xyz2lab01("b",${'mm'.$s.'x'},${'mm'.$s.'y'},${'mm'.$s.'z'});
${'mm'.$s.'D'}=DensitySp38("M",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
$Pdot=6+10*($s-1);////////////////////M50
${'mm50'.$s.'x'}=sp38XYZ("X",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mm50'.$s.'y'}=sp38XYZ("Y",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mm50'.$s.'z'}=sp38XYZ("Z",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mm50'.$s.'l'}=xyz2lab01("l",${'mm50'.$s.'x'},${'mm50'.$s.'y'},${'mm50'.$s.'z'});
${'mm50'.$s.'a'}=xyz2lab01("a",${'mm50'.$s.'x'},${'mm50'.$s.'y'},${'mm50'.$s.'z'});
${'mm50'.$s.'b'}=xyz2lab01("b",${'mm50'.$s.'x'},${'mm50'.$s.'y'},${'mm50'.$s.'z'});
${'mm50'.$s.'D'}=DensitySp38("M",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'TVIm'.$s}=((($PX-0.55*$PZ)-(${'mm50'.$s.'x'}-0.55*${'mm50'.$s.'z'}))/(($PX-0.55*$PZ)-(${'mm'.$s.'x'}-0.55*${'mm'.$s.'z'})))*100;
////////////////////////////////////sec Y
$Pdot=3+10*($s-1);///////////////////////////////////////Y100
${'my'.$s.'x'}=sp38XYZ("X",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'my'.$s.'y'}=sp38XYZ("Y",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'my'.$s.'z'}=sp38XYZ("Z",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'my'.$s.'l'}=xyz2lab01("l",${'my'.$s.'x'},${'my'.$s.'y'},${'my'.$s.'z'});
${'my'.$s.'a'}=xyz2lab01("a",${'my'.$s.'x'},${'my'.$s.'y'},${'my'.$s.'z'});
${'my'.$s.'b'}=xyz2lab01("b",${'my'.$s.'x'},${'my'.$s.'y'},${'my'.$s.'z'});
${'my'.$s.'D'}=DensitySp38("Y",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
$Pdot=7+10*($s-1);///////////////////////////////////////Y50
${'my50'.$s.'x'}=sp38XYZ("X",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'my50'.$s.'y'}=sp38XYZ("Y",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'my50'.$s.'z'}=sp38XYZ("Z",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'my50'.$s.'l'}=xyz2lab01("l",${'my50'.$s.'x'},${'my50'.$s.'y'},${'my50'.$s.'z'});
${'my50'.$s.'a'}=xyz2lab01("a",${'my50'.$s.'x'},${'my50'.$s.'y'},${'my50'.$s.'z'});
${'my50'.$s.'b'}=xyz2lab01("b",${'my50'.$s.'x'},${'my50'.$s.'y'},${'my50'.$s.'z'});
${'my50'.$s.'D'}=DensitySp38("Y",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'TVIy'.$s}=((($PX-0.55*$PZ)-(${'my50'.$s.'x'}-0.55*${'my50'.$s.'z'}))/(($PX-0.55*$PZ)-(${'my'.$s.'x'}-0.55*${'my'.$s.'z'})))*100;
$Pdot=9+10*($s-1);///////////////////////////////////////Gray
${'mg'.$s.'x'}=sp38XYZ("X",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mg'.$s.'y'}=sp38XYZ("Y",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mg'.$s.'z'}=sp38XYZ("Z",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
${'mg'.$s.'l'}=xyz2lab01("l",${'mg'.$s.'x'},${'mg'.$s.'y'},${'mg'.$s.'z'});
${'mg'.$s.'a'}=xyz2lab01("a",${'mg'.$s.'x'},${'mg'.$s.'y'},${'mg'.$s.'z'});
${'mg'.$s.'b'}=xyz2lab01("b",${'mg'.$s.'x'},${'mg'.$s.'y'},${'mg'.$s.'z'});
${'mg'.$s.'D'}=DensitySp38("K",$dot[9+$cols*$Pdot-$Pdot],$dot[9+$cols*$Pdot-$Pdot+1],$dot[9+$cols*$Pdot-$Pdot+2],$dot[9+$cols*$Pdot-$Pdot+3],$dot[9+$cols*$Pdot-$Pdot+4],$dot[9+$cols*$Pdot-$Pdot+5],$dot[9+$cols*$Pdot-$Pdot+6],$dot[9+$cols*$Pdot-$Pdot+7],$dot[9+$cols*$Pdot-$Pdot+8],$dot[9+$cols*$Pdot-$Pdot+9],$dot[9+$cols*$Pdot-$Pdot+10],$dot[9+$cols*$Pdot-$Pdot+11],$dot[9+$cols*$Pdot-$Pdot+12],$dot[9+$cols*$Pdot-$Pdot+13],$dot[9+$cols*$Pdot-$Pdot+14],$dot[9+$cols*$Pdot-$Pdot+15],$dot[9+$cols*$Pdot-$Pdot+16],$dot[9+$cols*$Pdot-$Pdot+17],$dot[9+$cols*$Pdot-$Pdot+18],$dot[9+$cols*$Pdot-$Pdot+19],$dot[9+$cols*$Pdot-$Pdot+20],$dot[9+$cols*$Pdot-$Pdot+21],$dot[9+$cols*$Pdot-$Pdot+22],$dot[9+$cols*$Pdot-$Pdot+23],$dot[9+$cols*$Pdot-$Pdot+24],$dot[9+$cols*$Pdot-$Pdot+25],$dot[9+$cols*$Pdot-$Pdot+26],$dot[9+$cols*$Pdot-$Pdot+27],$dot[9+$cols*$Pdot-$Pdot+28],$dot[9+$cols*$Pdot-$Pdot+29],$dot[9+$cols*$Pdot-$Pdot+30],$dot[9+$cols*$Pdot-$Pdot+31],$dot[9+$cols*$Pdot-$Pdot+32],$dot[9+$cols*$Pdot-$Pdot+33],$dot[9+$cols*$Pdot-$Pdot+34],$dot[9+$cols*$Pdot-$Pdot+35]);
}/////////////400 for loop
}////////////////////////////fMark ColorPort
$dec=de00($RPCCl,$RPCCa,$RPCCb,$mcl,$mca,$mcb);
$dem=de00($RPCMl,$RPCMa,$RPCMb,$mml,$mma,$mmb);
$dey=de00($RPCYl,$RPCYa,$RPCYb,$myl,$mya,$myb);
$dek=de00($RPCKl,$RPCKa,$RPCKb,$mkl,$mka,$mkb);
$dec50=de00($RPCC50l,$RPCC50a,$RPCC50b,$mc50l,$mc50a,$mc50b);
$dem50=de00($RPCM50l,$RPCM50a,$RPCM50b,$mm50l,$mm50a,$mm50b);
$dey50=de00($RPCY50l,$RPCY50a,$RPCY50b,$my50l,$my50a,$my50b);
$dek50=de00($RPCK50l,$RPCK50a,$RPCK50b,$mk50l,$mk50a,$mk50b);
$deg=de00($RPCgl,$RPCga,$RPCgb,$mgl,$mga,$mgb);
?>
<p><p>
<table width="400" border="1" align="center">
<tr>
<td>
<td colspan = "3">Original data</td>
<td colspan = "3">SCCA data</td>
</tr>
<tr>
<td>Paper</td>
<td>95</td>
<td>1</td>
<td>-4</td>
<td><?php echo $PL;?></td>
<td><?php echo $Pa;?></td>
<td><?php echo $Pb;?></td>
</tr>
<tr>
<td bgcolor="#00FFFF">100C</td>
<td bgcolor="#00FFFF"><?php echo $RPCCl;?></td>
<td bgcolor="#00FFFF"><?php echo $RPCCa;?></td>
<td bgcolor="#00FFFF"><?php echo $RPCCb;?></td>
<td bgcolor="#00FFFF"><?php echo round($scCL,2);?></td>
<td bgcolor="#00FFFF"><?php echo round($scCa,2);?></td>
<td bgcolor="#00FFFF"><?php echo round($scCb,2);?></td>
</tr>
<tr>
<td bgcolor="#FFCCFF">100M</td>
<td bgcolor="#FFCCFF"><?php echo $RPCMl;?></td>
<td bgcolor="#FFCCFF"><?php echo $RPCMa;?></td>
<td bgcolor="#FFCCFF"><?php echo $RPCMb;?></td>
<td bgcolor="#FFCCFF"><?php echo round($scML,2);?></td>
<td bgcolor="#FFCCFF"><?php echo round($scMa,2);?></td>
<td bgcolor="#FFCCFF"><?php echo round($scMb,2);?></td>
</tr>
<td bgcolor="#FFFF66">100Y</td>
<td bgcolor="#FFFF66"><?php echo $RPCYl;?></td>
<td bgcolor="#FFFF66"><?php echo $RPCYa;?></td>
<td bgcolor="#FFFF66"><?php echo $RPCYb;?></td>
<td bgcolor="#FFFF66"><?php echo round($scYL,2);?></td>
<td bgcolor="#FFFF66"><?php echo round($scYa,2);?></td>
<td bgcolor="#FFFF66"><?php echo round($scYb,2);?></td>
</tr>
<td bgcolor="#BBBBBB">100K</td>
<td bgcolor="#BBBBBB"><?php echo $RPCKl;?></td>
<td bgcolor="#BBBBBB"><?php echo $RPCKa;?></td>
<td bgcolor="#BBBBBB"><?php echo $RPCKb;?></td>
<td bgcolor="#BBBBBB"><?php echo round($scKL,2);?></td>
<td bgcolor="#BBBBBB"><?php echo round($scKa,2);?></td>
<td bgcolor="#BBBBBB"><?php echo round($scKb,2);?></td>
</tr>
<td bgcolor="#CCFFFF">50C</td>
<td bgcolor="#CCFFFF"><?php echo $RPCC50l;?></td>
<td bgcolor="#CCFFFF"><?php echo $RPCC50a;?></td>
<td bgcolor="#CCFFFF"><?php echo $RPCC50b;?></td>
<td bgcolor="#CCFFFF"><?php echo round($scC50L,2);?></td>
<td bgcolor="#CCFFFF"><?php echo round($scC50a,2);?></td>
<td bgcolor="#CCFFFF"><?php echo round($scC50b,2);?></td>
</tr>
<td bgcolor="#FFDDFF">50M</td>
<td bgcolor="#FFDDFF"><?php echo $RPCM50l;?></td>
<td bgcolor="#FFDDFF"><?php echo $RPCM50a;?></td>
<td bgcolor="#FFDDFF"><?php echo $RPCM50b;?></td>
<td bgcolor="#FFDDFF"><?php echo round($scM50L,2);?></td>
<td bgcolor="#FFDDFF"><?php echo round($scM50a,2);?></td>
<td bgcolor="#FFDDFF"><?php echo round($scM50b,2);?></td>
</tr>
<td bgcolor="#FFFFCC">50Y</td>
<td bgcolor="#FFFFCC"><?php echo $RPCY50l;?></td>
<td bgcolor="#FFFFCC"><?php echo $RPCY50a;?></td>
<td bgcolor="#FFFFCC"><?php echo $RPCY50b;?></td>
<td bgcolor="#FFFFCC"><?php echo round($scY50L,2);?></td>
<td bgcolor="#FFFFCC"><?php echo round($scY50a,2);?></td>
<td bgcolor="#FFFFCC"><?php echo round($scY50b,2);?></td>
</tr>
<td bgcolor="#DDDDDD">50K</td>
<td bgcolor="#DDDDDD"><?php echo $RPCK50l;?></td>
<td bgcolor="#DDDDDD"><?php echo $RPCK50a;?></td>
<td bgcolor="#DDDDDD"><?php echo $RPCK50b;?></td>
<td bgcolor="#DDDDDD"><?php echo round($scK50L,2);?></td>
<td bgcolor="#DDDDDD"><?php echo round($scK50a,2);?></td>
<td bgcolor="#DDDDDD"><?php echo round($scK50b,2);?></td>
</tr>
<td bgcolor="#DDDCCF">504040</td>
<td bgcolor="#DDDCCF"><?php echo $RPCgl;?></td>
<td bgcolor="#DDDCCF"><?php echo $RPCga;?></td>
<td bgcolor="#DDDCCF"><?php echo $RPCgb;?></td>
<td bgcolor="#DDDCCF"><?php echo round($scgL,2);?></td>
<td bgcolor="#DDDCCF"><?php echo round($scga,2);?></td>
<td bgcolor="#DDDCCF"><?php echo round($scgb,2);?></td>
</tr>
</table>
<p><p>
<p> </p>
<table border="1" align="center" cellpadding="0" cellspacing="0">
<col width="87" />
<col width="83" />
<col width="71" span="2" />
<col width="83" />
<col width="56" />
<col width="53" />
<col width="83" />
<col width="53" />
<col width="56" />
<col width="83" />
<col width="47" span="2" />
<col width="83" />
<col width="63" span="2" />
<col width="83" />
<col width="56" />
<col width="63" />
<col width="83" />
<col width="47" />
<col width="49" />
<col width="83" />
<col width="47" />
<col width="53" />
<col width="83" />
<col width="41" />
<col width="47" />
<tr>
<td width="87"></td>
<td colspan = "3" bgcolor="#00CCFF">Reference_C100</td>
<td colspan = "3" bgcolor="#FFCCFF">Reference_M100</td>
<td colspan = "3" bgcolor="#FFFF99">Reference_Y100</td>
<td colspan = "3" bgcolor="#CCCCCC">Reference_K100</td>
<td colspan = "3" bgcolor="#00DDFF">Reference_C50</td>
<td colspan = "3" bgcolor="#FFDDFF">Reference_M50</td>
<td colspan = "3" bgcolor="#FFFFDD">Reference_Y50</td>
<td colspan = "3" bgcolor="#CCCCCC">Reference_K50</td>
<td colspan = "3" bgcolor="#CCCCCC">Reference_50/40/40</td>
</tr>
<tr>
<td></td>
<td bgcolor="#00CCFF"><?php echo round($scCL,2);?></td>
<td bgcolor="#00CCFF"><?php echo round($scCa,2);?></td>
<td bgcolor="#00CCFF"><?php echo round($scCb,2);?></td>
<td bgcolor="#FFCCFF"><?php echo round($scML,2);?></td>
<td bgcolor="#FFCCFF"><?php echo round($scMa,2);?></td>
<td bgcolor="#FFCCFF"><?php echo round($scMb,2);?></td>
<td bgcolor="#FFFF99"><?php echo round($scYL,2);?></td>
<td bgcolor="#FFFF99"><?php echo round($scYa,2);?></td>
<td bgcolor="#FFFF99"><?php echo round($scYb,2);?></td>
<td bgcolor="#CCCCCC"><?php echo round($scKL,2);?></td>
<td bgcolor="#CCCCCC"><?php echo round($scKa,2);?></td>
<td bgcolor="#CCCCCC"><?php echo round($scKb,2);?></td>
<td bgcolor="#00DDFF"><?php echo round($scC50L,2);?></td>
<td bgcolor="#00DDFF"><?php echo round($scC50a,2);?></td>
<td bgcolor="#00DDFF"><?php echo round($scC50b,2);?></td>
<td bgcolor="#FFDDFF"><?php echo round($scM50L,2);?></td>
<td bgcolor="#FFDDFF"><?php echo round($scM50a,2);?></td>
<td bgcolor="#FFDDFF"><?php echo round($scM50b,2);?></td>
<td bgcolor="#FFFFDD"><?php echo round($scY50L,2);?></td>
<td bgcolor="#FFFFDD"><?php echo round($scY50a,2);?></td>
<td bgcolor="#FFFFDD"><?php echo round($scY50b,2);?></td>
<td bgcolor="#CCCCCC"><?php echo round($scK50L,2);?></td>
<td bgcolor="#CCCCCC"><?php echo round($scK50a,2);?></td>
<td bgcolor="#CCCCCC"><?php echo round($scK50b,2);?></td>
<td bgcolor="#CCCCCC"><?php echo round($scgL,2);?></td>
<td bgcolor="#CCCCCC"><?php echo round($scga,2);?></td>
<td bgcolor="#CCCCCC"><?php echo round($scgb,2);?></td>
</tr>
<tr>
<td></td>
<td colspan = "3" bgcolor="#00CCFF">20 samples</td>
<td colspan = "3" bgcolor="#FFCCFF">20 samples</td>
<td colspan = "3" bgcolor="#FFFF99">20 samples</td>
<td colspan = "3" bgcolor="#CCCCCC">20 samples</td>
<td colspan = "3" bgcolor="#00DDFF">20 samples</td>
<td colspan = "3" bgcolor="#FFDDFF">20 samples</td>
<td colspan = "3" bgcolor="#FFFFDD">20 samples</td>
<td colspan = "3" bgcolor="#CCCCCC">20 samples</td>
<td colspan = "3" bgcolor="#CCCCCC">20 samples</td>
</tr>
<tr>
<td>ID</td>
<td>L*</td>
<td>a*</td>
<td>b*</td>
<td>L*</td>
<td>a*</td>
<td>b*</td>
<td>L*</td>
<td>a*</td>
<td>b*</td>
<td>L*</td>
<td>a*</td>
<td>b*</td>
<td>L*</td>
<td>a*</td>
<td>b*</td>
<td>L*</td>
<td>a*</td>
<td>b*</td>
<td>L*</td>
<td>a*</td>
<td>b*</td>
<td>L*</td>
<td>a*</td>
<td>b*</td>
<td>L*</td>
<td>a*</td>
<td>b*</td>
</tr>
<?php
for ($s=1; $s<=20; $s+=1) {///////
?>
<tr>
<td><?php echo $s;?></td>
<td><?php echo round(${'mc'.$s.'l'},2);?></td>
<td><?php echo round(${'mc'.$s.'a'},2);?></td>
<td><?php echo round(${'mc'.$s.'b'},2);?></td>
<td><?php echo round(${'mm'.$s.'l'},2);?></td>
<td><?php echo round(${'mm'.$s.'a'},2);?></td>
<td><?php echo round(${'mm'.$s.'b'},2);?></td>
<td><?php echo round(${'my'.$s.'l'},2);?></td>
<td><?php echo round(${'my'.$s.'a'},2);?></td>
<td><?php echo round(${'my'.$s.'b'},2);?></td>
<td><?php echo round(${'mk'.$s.'l'},2);?></td>
<td><?php echo round(${'mk'.$s.'a'},2);?></td>
<td><?php echo round(${'mk'.$s.'b'},2);?></td>
<td><?php echo round(${'mc50'.$s.'l'},2);?></td>
<td><?php echo round(${'mc50'.$s.'a'},2);?></td>
<td><?php echo round(${'mc50'.$s.'b'},2);?></td>
<td><?php echo round(${'mm50'.$s.'l'},2);?></td>
<td><?php echo round(${'mm50'.$s.'a'},2);?></td>
<td><?php echo round(${'mm50'.$s.'b'},2);?></td>
<td><?php echo round(${'my50'.$s.'l'},2);?></td>
<td><?php echo round(${'my50'.$s.'a'},2);?></td>
<td><?php echo round(${'my50'.$s.'b'},2);?></td>
<td><?php echo round(${'mk50'.$s.'l'},2);?></td>
<td><?php echo round(${'mk50'.$s.'a'},2);?></td>
<td><?php echo round(${'mk50'.$s.'b'},2);?></td>
<td><?php echo round(${'mg'.$s.'l'},2);?></td>
<td><?php echo round(${'mg'.$s.'a'},2);?></td>
<td><?php echo round(${'mg'.$s.'b'},2);?></td>
</tr>
<?php } ?>
</table>
<br>
<table border="1" align="center" cellpadding="1" cellspacing="1">
<col width="87">
<col width="83">
<col width="71" span="2">
<col width="83">
<col width="56">
<col width="53">
<col width="83">
<col width="53">
<col width="56">
<tr>
<td width="87">Tol CIEDE00</td>
<td width="83" align="center" bgcolor="#00CCFF">C100</td>
<td width="71" align="center" bgcolor="#FFCCFF">M100</td>
<td width="71" align="center" bgcolor="#FFFF99">Y100</td>
<td width="83" align="center" bgcolor="#CCCCCC">K100</td>
<td width="56" align="center" bgcolor="#00CCFF">C50</td>
<td width="53" align="center" bgcolor="#FFCCFF">M50</td>
<td width="83" align="center" bgcolor="#FFFFCC">Y50</td>
<td width="53" align="center" bgcolor="#CCCCCC">K50</td>
<td width="56" align="center" bgcolor="#CCCCCC">50/40/40</td>
</tr>
<tr>
<td>Level A</td>
<td align="right" bgcolor="#00CCFF">1.50</td>
<td align="right" bgcolor="#FFCCFF">1.50</td>
<td align="right" bgcolor="#FFFF99">1.50</td>
<td align="right" bgcolor="#CCCCCC">2.40</td>
<td align="right" bgcolor="#00CCFF">1.50</td>
<td align="right" bgcolor="#FFCCFF">1.50</td>
<td align="right" bgcolor="#FFFFCC">1.50</td>
<td align="right" bgcolor="#CCCCCC">1.50</td>
<td align="right" bgcolor="#CCCCCC">3.00</td>
</tr>
<tr>
<td>Level B</td>
<td align="right" bgcolor="#00CCFF">2.4</td>
<td align="right" bgcolor="#FFCCFF">2.4</td>
<td align="right" bgcolor="#FFFF99">2.4</td>
<td align="right" bgcolor="#CCCCCC">3.6</td>
<td align="right" bgcolor="#00CCFF">2</td>
<td align="right" bgcolor="#FFCCFF">2</td>
<td align="right" bgcolor="#FFFFCC">2</td>
<td align="right" bgcolor="#CCCCCC">2</td>
<td align="right" bgcolor="#CCCCCC">3.5</td>
</tr>
<tr>
<td>Level C</td>
<td align="right" bgcolor="#00CCFF">4</td>
<td align="right" bgcolor="#FFCCFF">4</td>
<td align="right" bgcolor="#FFFF99">4</td>
<td align="right" bgcolor="#CCCCCC">6</td>
<td align="right" bgcolor="#00CCFF">2.5</td>
<td align="right" bgcolor="#FFCCFF">2.5</td>
<td align="right" bgcolor="#FFFFCC">2.5</td>
<td align="right" bgcolor="#CCCCCC">2.5</td>
<td align="right" bgcolor="#CCCCCC">5</td>
</tr>
<?php
$rangeC = array();$rangeM = array();$rangeY = array();$rangeK = array();
$rangeC50 = array();$rangeM50 = array();$rangeY50 = array();$rangeK50 = array();
$rangeG = array();
for ( $i = 1; $i <= 20; $i+= 1) {
${'dec'.$i}=de00($RPCCl,$RPCCa,$RPCCb,${'mc'.$i.'l'},${'mc'.$i.'a'},${'mc'.$i.'b'});
${'dem'.$i}=de00($RPCMl,$RPCMa,$RPCMb,${'mm'.$i.'l'},${'mm'.$i.'a'},${'mm'.$i.'b'});
${'dey'.$i}=de00($RPCYl,$RPCYa,$RPCYb,${'my'.$i.'l'},${'my'.$i.'a'},${'my'.$i.'b'});
${'dek'.$i}=de00($RPCKl,$RPCKa,$RPCKb,${'mk'.$i.'l'},${'mk'.$i.'a'},${'mk'.$i.'b'});
${'dec50'.$i}=de00($RPCC50l,$RPCC50a,$RPCC50b,${'mc50'.$i.'l'},${'mc50'.$i.'a'},${'mc50'.$i.'b'});
${'dem50'.$i}=de00($RPCM50l,$RPCM50a,$RPCM50b,${'mm50'.$i.'l'},${'mm50'.$i.'a'},${'mm50'.$i.'b'});
${'dey50'.$i}=de00($RPCY50l,$RPCY50a,$RPCY50b,${'my50'.$i.'l'},${'my50'.$i.'a'},${'my50'.$i.'b'});
${'dek50'.$i}=de00($RPCK50l,$RPCK50a,$RPCK50b,${'mk50'.$i.'l'},${'mk50'.$i.'a'},${'mk50'.$i.'b'});
${'deg'.$i}=de00($RPCgl,$RPCga,$RPCgb,${'mg'.$i.'l'},${'mg'.$i.'a'},${'mg'.$i.'b'});
$rangeC[$i] = ${'dec'.$i};
$rangeM[$i] = ${'dem'.$i};
$rangeY[$i] = ${'dey'.$i};
$rangeK[$i] = ${'dek'.$i};
$rangeC50[$i] = ${'dec50'.$i};
$rangeM50[$i] = ${'dem50'.$i};
$rangeY50[$i] = ${'dey50'.$i};
$rangeK50[$i] = ${'dek50'.$i};
$rangeG[$i] = ${'deg'.$i};
?>
<tr>
<td><?php echo $i;?></td>
<td align="right" bgcolor="#FFFFFF"><?php echo round(${'dec'.$i},2);?></td>
<td align="right" bgcolor="#FFFFFF"><?php echo round(${'dem'.$i},2);?></td>
<td align="right" bgcolor="#FFFFFF"><?php echo round(${'dey'.$i},2);?></td>
<td align="right" bgcolor="#FFFFFF"><?php echo round(${'dek'.$i},2);?></td>
<td align="right" bgcolor="#FFFFFF"><?php echo round(${'dec50'.$i},2);?></td>
<td align="right" bgcolor="#FFFFFF"><?php echo round(${'dem50'.$i},2);?></td>
<td align="right" bgcolor="#FFFFFF"><?php echo round(${'dey50'.$i},2);?></td>
<td align="right" bgcolor="#FFFFFF"><?php echo round(${'dek50'.$i},2);?></td>
<td align="right" bgcolor="#FFFFFF"><?php echo round(${'deg'.$i},2);?></td>
</tr>
<?php
}
sort($rangeC);sort($rangeM);sort($rangeY);sort($rangeK);
sort($rangeC50);sort($rangeM50);sort($rangeY50);sort($rangeK50);
sort($rangeG);
$C95 = $rangeC[round((94/100) * count($rangeC) -0.5)];
$M95 = $rangeM[round((94/100) * count($rangeM) -0.5)];
$Y95 = $rangeY[round((94/100) * count($rangeY) -0.5)];
$K95 = $rangeK[round((94/100) * count($rangeK) -0.5)];
$C5095 = $rangeC50[round((94/100) * count($rangeC50) -0.5)];
$M5095 = $rangeM50[round((94/100) * count($rangeM50) -0.5)];
$Y5095 = $rangeY50[round((94/100) * count($rangeY50) -0.5)];
$K5095 = $rangeK50[round((94/100) * count($rangeK50) -0.5)];
$G95 = $rangeG[round((94/100) * count($rangeG) -0.5)];
?>
<tr>
<td>95th% </td>
<?php if ($C95<1.50) {
echo '<td bgcolor="#008000">';}
elseif ($C95<2.40) {
echo '<td bgcolor="#75923c">';}
elseif ($C95<4.000) {
echo '<td bgcolor="#d7e4bc">';}
else {echo '<td bgcolor="#ff003a">';}
echo round($C95,2);?></td>
<?php if ($M95<1.50) {
echo '<td bgcolor="#008000">';}
elseif ($M95<2.40) {
echo '<td bgcolor="#75923c">';}
elseif ($M95<4.000) {
echo '<td bgcolor="#d7e4bc">';}
else {echo '<td bgcolor="#ff003a">';}
echo round($M95,2);?></td>
<?php if ($Y95<1.50) {
echo '<td bgcolor="#008000">';}
elseif ($Y95<2.40) {
echo '<td bgcolor="#75923c">';}
elseif ($Y95<4.000) {
echo '<td bgcolor="#d7e4bc">';}
else {echo '<td bgcolor="#ff003a">';}
echo round($Y95,2);?></td>
<?php if ($K95<2.40) {
echo '<td bgcolor="#008000">';}
elseif ($K95<3.60) {
echo '<td bgcolor="#75923c">';}
elseif ($K95<6.000) {
echo '<td bgcolor="#d7e4bc">';}
else {echo '<td bgcolor="#ff003a">';}
echo round($K95,2);?></td>
<?php if ($C5095<1.50) {
echo '<td bgcolor="#008000">';}
elseif ($C5095<2.00) {
echo '<td bgcolor="#75923c">';}
elseif ($C5095<2.50) {
echo '<td bgcolor="#d7e4bc">';}
else {echo '<td bgcolor="#ff003a">';}
echo round($C5095,2);?></td>
<?php if ($M5095<1.50) {
echo '<td bgcolor="#008000">';}
elseif ($M5095<2.00) {
echo '<td bgcolor="#75923c">';}
elseif ($M5095<2.50) {
echo '<td bgcolor="#d7e4bc">';}
else {echo '<td bgcolor="#ff003a">';}
echo round($M5095,2);?></td>
<?php if ($Y5095<1.50) {
echo '<td bgcolor="#008000">';}
elseif ($Y5095<2.00) {
echo '<td bgcolor="#75923c">';}
elseif ($Y5095<2.500) {
echo '<td bgcolor="#d7e4bc">';}
else {echo '<td bgcolor="#ff003a">';}
echo round($Y5095,2);?></td>
<?php if ($K5095<1.50) {
echo '<td bgcolor="#008000">';}
elseif ($K5095<2.00) {
echo '<td bgcolor="#75923c">';}
elseif ($K5095<2.500) {
echo '<td bgcolor="#d7e4bc">';}
else {echo '<td bgcolor="#ff003a">';}
echo round($K5095,2);?></td>
<?php if ($G95<3.00) {
echo '<td bgcolor="#008000">';}
elseif ($G95<3.50) {
echo '<td bgcolor="#75923c">';}
elseif ($G95<5.000) {
echo '<td bgcolor="#d7e4bc">';}
else {echo '<td bgcolor="#ff003a">';}
echo round($G95,2);?></td>
</tr>
<tr>
<td>Level</td>
<?php if ($C95<1.50) {
echo '<td>A</td>';}
elseif ($C95<2.40) {
echo '<td>B</td>';}
elseif ($C95<4.00) {
echo '<td>C</td>';}
else {echo '<td>F</td>';} ?>
<?php if ($M95<1.50) {
echo '<td>A</td>';}
elseif ($M95<2.40) {
echo '<td>B</td>';}
elseif ($M95<4.00) {
echo '<td>C</td>';}
else {echo '<td>F</td>';} ?>
<?php if ($Y95<1.50) {
echo '<td>A</td>';}
elseif ($Y95<2.40) {
echo '<td>B</td>';}
elseif ($Y95<4.00) {
echo '<td>C</td>';}
else {echo '<td>F</td>';} ?>
<?php if ($K95<2.4) {
echo '<td>A</td>';}
elseif ($K95<3.60) {
echo '<td>B</td>';}
elseif ($K95<6.00) {
echo '<td>C</td>';}
else {echo '<td>F</td>';} ?>
<?php if ($C5095<1.50) {
echo '<td>A</td>';}
elseif ($C5095<2.00) {
echo '<td>B</td>';}
elseif ($C5095<2.50) {
echo '<td>C</td>';}
else {echo '<td>F</td>';} ?>
<?php if ($M5095<1.50) {
echo '<td>A</td>';}
elseif ($M5095<2.00) {
echo '<td>B</td>';}
elseif ($M5095<2.50) {
echo '<td>C</td>';}
else {echo '<td>F</td>';} ?>
<?php if ($Y5095<1.50) {
echo '<td>A</td>';}
elseif ($Y5095<2.00) {
echo '<td>B</td>';}
elseif ($Y5095<2.50) {
echo '<td>C</td>';}
else {echo '<td>F</td>';} ?>
<?php if ($K5095<1.50) {
echo '<td>A</td>';}
elseif ($K5095<2.00) {
echo '<td>B</td>';}
elseif ($K5095<2.50) {
echo '<td>C</td>';}
else {echo '<td>F</td>';} ?>
<?php if ($G95<3.00) {
echo '<td>A</td>';}
elseif ($G95<3.50) {
echo '<td>B</td>';}
elseif ($G95<5.00) {
echo '<td>C</td>';}
else {echo '<td>F</td>';} ?>
</tr>
<tr>
<td>Score</td>
<?php if ($C95<1.50) {
$C95S=3;echo '<td>3</td>';}
elseif ($C95<2.40) {
$C95S=2;echo '<td>2</td>';}
elseif ($C95<4.00) {
$C95S=1;echo '<td>1</td>';}
else {$C95S=0;echo '<td>0</td>';} ?>
<?php if ($M95<1.50) {
$M95S=3;echo '<td>3</td>';}
elseif ($M95<2.40) {
$M95S=2;echo '<td>2</td>';}
elseif ($M95<4.00) {
$M95S=1;echo '<td>1</td>';}
else {$M95S=0;echo '<td>0</td>';} ?>
<?php if ($Y95<1.50) {
$Y95S=3;echo '<td>3</td>';}
elseif ($Y95<2.40) {
$Y95S=2;echo '<td>2</td>';}
elseif ($Y95<4.00) {
$Y95S=1;echo '<td>1</td>';}
else {$Y95S=0;echo '<td>0</td>';} ?>
<?php if ($K95<2.4) {
$K95S=3;echo '<td>3</td>';}
elseif ($K95<3.60) {
$K95S=2;echo '<td>2</td>';}
elseif ($K95<6.00) {
$K95S=1;echo '<td>1</td>';}
else {$K95S=0;echo '<td>0</td>';} ?>
<?php if ($C5095<1.50) {
$C5095S=3;echo '<td>3</td>';}
elseif ($C5095<2.00) {
$C5095S=2;echo '<td>2</td>';}
elseif ($C5095<2.50) {
$C5095S=1;echo '<td>1</td>';}
else {$C5095S=0;echo '<td>0</td>';} ?>
<?php if ($M5095<1.50) {
$M5095S=3;echo '<td>3</td>';}
elseif ($M5095<2.00) {
$M5095S=2;echo '<td>2</td>';}
elseif ($M5095<2.50) {
$M5095S=1;echo '<td>1</td>';}
else {$M5095S=0;echo '<td>0</td>';} ?>
<?php if ($Y5095<1.50) {
$Y5095S=3;echo '<td>3</td>';}
elseif ($Y5095<2.00) {
$Y5095S=2;echo '<td>2</td>';}
elseif ($Y5095<2.50) {
$Y5095S=1;echo '<td>1</td>';}
else {$Y5095S=0;echo '<td>0</td>';} ?>
<?php if ($K5095<1.50) {
$K5095S=3;echo '<td>3</td>';}
elseif ($K5095<2.00) {
$K5095S=2;echo '<td>2</td>';}
elseif ($K5095<2.50) {
$K5095S=1;echo '<td>1</td>';}
else {$K5095S=0;echo '<td>0</td>';} ?>
<?php if ($G95<3.00) {
$G95S=3;echo '<td>3</td>';}
elseif ($G95<3.50) {
$G95S=2;echo '<td>2</td>';}
elseif ($G95<5.00) {
$G95S=1;echo '<td>1</td>';}
else {$G95S=0;echo '<td>0</td>';} ?>
</tr>
</table>
<hr size="5">
<p>Production Variation Chart<p>
<p>
<p>
<table width="200" border="1" align="center"> <font color="green">
<tr>
<td><div align="center">
<?php // content="text/plain; charset=utf-8"
$connection = mysql_connect("127.0.0.1", "root", "fredsql") or die ("Unable to connect!");
mysql_query("SET NAMES 'utf8'");
$db = "tvicheck-st";
// select database
mysql_select_db($db) or die ("Unable to select database!");
// generate and execute query
$queryID="select id from psaProduction2 ORDER BY id DESC limit 0,1";
$resultID = mysql_query($queryID) or die ("Error in query: $query. " . mysql_error());
while ($row=mysql_fetch_object($resultID))
{
$imgID=$row->id;
}
mysql_close($connection);
require_once ('../jpgraph/jpgraph.php');
$CMYSIDN="./image/".$imgID."-CMYSID.png";
require_once ('../jpgraph/jpgraph_line.php');
require_once ('../jpgraph/jpgraph_plotline.php');
//unlink('CMYSID.png');
$datay1 = array($dec1,$dec2,$dec3,$dec4,$dec5,$dec6,$dec7,$dec8,$dec9,$dec10,$dec11,$dec12,$dec13,$dec14,$dec15,$dec16,$dec17,$dec18,$dec19,$dec20);
$datay2 = array($dem1,$dem2,$dem3,$dem4,$dem5,$dem6,$dem7,$dem8,$dem9,$dem10,$dem11,$dem12,$dem13,$dem14,$dem15,$dem16,$dem17,$dem18,$dem19,$dem20);
$datay3 = array($dey1,$dey2,$dey3,$dey4,$dey5,$dey6,$dey7,$dey8,$dey9,$dey10,$dey11,$dey12,$dey13,$dey14,$dey15,$dey16,$dey17,$dey18,$dey19,$dey20);
// Setup the graph
$graph = new Graph(550,430);
$graph->SetScale("textint",0,6,0,0);
$theme_class= new UniversalTheme;
$graph->SetTheme($theme_class);
$graph->title->Set('CMY 100');
$graph->SetBox(false);
$graph->yaxis->HideZeroLabel();
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);
$graph->xaxis->title->Set("Sample ID");
$graph->yaxis->title->Set("de00");
//$graph->xaxis->SetTickLabels(array('0','5','10','20','30','40','50','60','70','80','90','95'));
$graph->ygrid->SetFill(false);
//$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME);
$p1 = new LinePlot($datay1);
$graph->Add($p1);
$p2 = new LinePlot($datay2);
$graph->Add($p2);
//$ADR=92.04-5.9;
//$BDR=91.12-6.32;
$p3 = new LinePlot($datay3);
$graph->Add($p3);
$p1->SetColor("#55bbdd");
$p1->SetLegend('C100');
$p1->mark->SetType(MARK_FILLEDCIRCLE,'',1.0);
$p1->mark->SetColor('#55bbdd');
$p1->mark->SetFillColor('#55bbdd');
$p1->SetCenter();
$p2->SetColor("#fcbffb");
$p2->SetLegend('M100');
$p2->mark->SetType(MARK_UTRIANGLE,'',1.0);
$p2->mark->SetColor('#fcbffb');
$p2->mark->SetFillColor('#fcbffb');
$p2->value->SetMargin(14);
$p2->SetCenter();
$p3->SetColor("#dce72a");
$p3->SetLegend('Y100');
$p3->mark->SetType(MARK_DIAMOND,'',1.0);
$p3->mark->SetColor('#dce72a');
$p3->mark->SetFillColor('#dce72a');
$p3->value->SetMargin(14);
$p3->SetCenter();
$sline = new PlotLine(HORIZONTAL,1.5,'#146f02',1.1);
$sline->SetLineStyle('dashed');
$sline->SetLegend("Level A");
$sline2 = new PlotLine(HORIZONTAL,2.4,'black',1.1);
$sline2->SetLineStyle('dashed');
$sline2->SetLegend("Level B");
$sline3 = new PlotLine(HORIZONTAL,4,'red',1.1);
$sline3->SetLineStyle('dashed');
$sline3->SetLegend("Level C");
$graph->Add($sline);
$graph->Add($sline2);
$graph->Add($sline3);
$graph->legend->SetFrameWeight(1);
$graph->legend->SetColor('#4E4E4E','#00A78A');
$graph->legend->SetMarkAbsSize(8);
// Output line
$graph->Stroke($CMYSIDN);
?>
<img src=<?php echo $CMYSIDN;?>>
</div></td>
<td><div align="center">
<?php // content="text/plain; charset=utf-8"
//require_once ('../jpgraph/jpgraph.php');
$CMYSID_DN="./image/".$imgID."-CMYSID_D.png";
require_once ('../jpgraph/jpgraph_line.php');
require_once ('../jpgraph/jpgraph_plotline.php');
//unlink('CMYSID_D.png');
$datay1 = array($mc1D,$mc2D,$mc3D,$mc4D,$mc5D,$mc6D,$mc7D,$mc8D,$mc9D,$mc10D,$mc11D,$mc12D,$mc13D,$mc14D,$mc15D,$mc16D,$mc17D,$mc18D,$mc19D,$mc20D);
$datay2 = array($mm1D,$mm2D,$mm3D,$mm4D,$mm5D,$mm6D,$mm7D,$mm8D,$mm9D,$mm10D,$mm11D,$mm12D,$mm13D,$mm14D,$mm15D,$mm16D,$mm17D,$mm18D,$mm19D,$mm20D);
$datay3 = array($my1D,$my2D,$my3D,$my4D,$my5D,$my6D,$my7D,$my8D,$my9D,$my10D,$my11D,$my12D,$my13D,$my14D,$my15D,$my16D,$my17D,$my18D,$my19D,$my20D);
// Setup the graph
$graph = new Graph(550,430);
$graph->SetScale("linint");
$theme_class= new UniversalTheme;
$graph->SetTheme($theme_class);
$graph->title->Set('CMY 100');
$graph->SetBox(false);
$graph->yaxis->HideZeroLabel();
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);
$graph->xaxis->title->Set("Sample ID");
$graph->yaxis->title->Set("Density");
//$graph->xaxis->SetTickLabels(array('0','5','10','20','30','40','50','60','70','80','90','95'));
$graph->ygrid->SetFill(false);
//$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME);
$p1 = new LinePlot($datay1);
$graph->Add($p1);
$p2 = new LinePlot($datay2);
$graph->Add($p2);
//$ADR=92.04-5.9;
//$BDR=91.12-6.32;
$p3 = new LinePlot($datay3);
$graph->Add($p3);
$p1->SetColor("#55bbdd");
$p1->SetLegend('C100');
$p1->mark->SetType(MARK_FILLEDCIRCLE,'',1.0);
$p1->mark->SetColor('#55bbdd');
$p1->mark->SetFillColor('#55bbdd');
$p1->SetCenter();
$p2->SetColor("#fcbffb");
$p2->SetLegend('MC100');
$p2->mark->SetType(MARK_UTRIANGLE,'',1.0);
$p2->mark->SetColor('#fcbffb');
$p2->mark->SetFillColor('#fcbffb');
$p2->value->SetMargin(14);
$p2->SetCenter();
$p3->SetColor("#dce72a");
$p3->SetLegend('Y100');
$p3->mark->SetType(MARK_DIAMOND,'',1.0);
$p3->mark->SetColor('#dce72a');
$p3->mark->SetFillColor('#dce72a');
$p3->value->SetMargin(14);
$p3->SetCenter();
$graph->legend->SetFrameWeight(1);
$graph->legend->SetColor('#4E4E4E','#00A78A');
$graph->legend->SetMarkAbsSize(8);
// Output line
$graph->Stroke($CMYSID_DN);
?>
<img src=<?php echo $CMYSID_DN;?>>
</div></td>
</tr>
</table>
<p>
<table width="200" border="1" align="center">
<tr>
<td><div align="center">
<?php // content="text/plain; charset=utf-8"
//require_once ('../jpgraph/jpgraph.php');
$KSIDN="./image/".$imgID."-KSID.png";
require_once ('../jpgraph/jpgraph_line.php');
require_once ('../jpgraph/jpgraph_plotline.php');
//unlink('KSID.png');
$datay1 = array($dek1,$dek2,$dek3,$dek4,$dek5,$dek6,$dek7,$dek8,$dek9,$dek10,$dek11,$dek12,$dek13,$dek14,$dek15,$dek16,$dek17,$dek18,$dek19,$dek20);
// Setup the graph
$graph = new Graph(550,430);
$graph->SetScale("textint",0,6,0,0);
$theme_class= new UniversalTheme;
$graph->SetTheme($theme_class);
$graph->title->Set('K100');
$graph->SetBox(false);
$graph->yaxis->HideZeroLabel();
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);
$graph->xaxis->title->Set("Sample ID");
$graph->yaxis->title->Set("de00");
//$graph->xaxis->SetTickLabels(array('0','5','10','20','30','40','50','60','70','80','90','95'));
$graph->ygrid->SetFill(false);
//$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME);
$p1 = new LinePlot($datay1);
$graph->Add($p1);
$p1->SetColor("#aaaaaa");
$p1->SetLegend('K100');
$p1->mark->SetType(MARK_FILLEDCIRCLE,'',1.0);
$p1->mark->SetColor('#aaaaaa');
$p1->mark->SetFillColor('#aaaaaa');
$p1->SetCenter();
$sline = new PlotLine(HORIZONTAL,2.4,'#146f02',1.1);
$sline->SetLineStyle('dashed');
$sline->SetLegend("Level A");
$sline2 = new PlotLine(HORIZONTAL,3.6,'black',1.1);
$sline2->SetLineStyle('dashed');
$sline2->SetLegend("Level B");
$sline3 = new PlotLine(HORIZONTAL,6,'red',1.1);
$sline3->SetLineStyle('dashed');
$sline3->SetLegend("Level C");
$graph->Add($sline);
$graph->Add($sline2);
$graph->Add($sline3);
$graph->legend->SetFrameWeight(1);
$graph->legend->SetColor('#4E4E4E','#00A78A');
$graph->legend->SetMarkAbsSize(8);
// Output line
$graph->Stroke($KSIDN);
?>
<img src=<?php echo $KSIDN;?>>
</div></td>
<td><div align="center">
<?php // content="text/plain; charset=utf-8"
//require_once ('../jpgraph/jpgraph.php');
$KSID_DN="./image/".$imgID."-KSID_D.png";
require_once ('../jpgraph/jpgraph_line.php');
require_once ('../jpgraph/jpgraph_plotline.php');
//unlink('KSID_D.png');
$datay1 = array($mk1D,$mk2D,$mk3D,$mk4D,$mk5D,$mk6D,$mk7D,$mk8D,$mk9D,$mk10D,$mk11D,$mk12D,$mk13D,$mk14D,$mk15D,$mk16D,$mk17D,$mk18D,$mk19D,$mk20D);
// Setup the graph
$graph = new Graph(550,430);
$graph->SetScale("linint");
$theme_class= new UniversalTheme;
$graph->SetTheme($theme_class);
$graph->title->Set('K100');
$graph->SetBox(false);
$graph->yaxis->HideZeroLabel();
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);
$graph->xaxis->title->Set("Sample ID");
$graph->yaxis->title->Set("Density");
//$graph->xaxis->SetTickLabels(array('0','5','10','20','30','40','50','60','70','80','90','95'));
$graph->ygrid->SetFill(false);
//$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME);
$p1 = new LinePlot($datay1);
$graph->Add($p1);
$p1->SetColor("#aaaaaa");
$p1->SetLegend('K100');
$p1->mark->SetType(MARK_FILLEDCIRCLE,'',1.0);
$p1->mark->SetColor('#aaaaaa');
$p1->mark->SetFillColor('#aaaaaa');
$p1->SetCenter();
$graph->legend->SetFrameWeight(1);
$graph->legend->SetColor('#4E4E4E','#00A78A');
$graph->legend->SetMarkAbsSize(8);
// Output line
$graph->Stroke($KSID_DN);
?>
<img src=<?php echo $KSID_DN;?>>
</div></td>
</tr>
</table>
<p>
<table width="200" border="1" align="center"> <font color="green">
<tr>
<td><div align="center">
<?php // content="text/plain; charset=utf-8"
//require_once ('../jpgraph/jpgraph.php');
$CMYK50N="./image/".$imgID."-CMYK50.png";
require_once ('../jpgraph/jpgraph_line.php');
require_once ('../jpgraph/jpgraph_line.php');
require_once ('../jpgraph/jpgraph_plotline.php');
//unlink('CMYK50.png');
$datay1 = array($dec501,$dec502,$dec503,$dec504,$dec505,$dec506,$dec507,$dec508,$dec509,$dec5010,$dec5011,$dec5012,$dec5013,$dec5014,$dec5015,$dec5016,$dec5017,$dec5018,$dec5019,$dec5020);
$datay2 = array($dem501,$dem502,$dem503,$dem504,$dem505,$dem506,$dem507,$dem508,$dem509,$dem5010,$dem5011,$dem5012,$dem5013,$dem5014,$dem5015,$dem5016,$dem5017,$dem5018,$dem5019,$dem5020);
$datay3 = array($dey501,$dey502,$dey503,$dey504,$dey505,$dey506,$dey507,$dey508,$dey509,$dey5010,$dey5011,$dey5012,$dey5013,$dey5014,$dey5015,$dey5016,$dey5017,$dey5018,$dey5019,$dey5020);
$datay4 = array($dek501,$dek502,$dek503,$dek504,$dek505,$dek506,$dek507,$dek508,$dek509,$dek5010,$dek5011,$dek5012,$dek5013,$dek5014,$dek5015,$dek5016,$dek5017,$dek5018,$dek5019,$dek5020);
// Setup the graph
$graph = new Graph(550,430);
$graph->SetScale("textint",0,6,0,0);
$theme_class= new UniversalTheme;
$graph->SetTheme($theme_class);
$graph->title->Set('CMYK 50');
$graph->SetBox(false);
$graph->yaxis->HideZeroLabel();
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);
$graph->xaxis->title->Set("Sample ID");
$graph->yaxis->title->Set("de00");
//$graph->xaxis->SetTickLabels(array('0','5','10','20','30','40','50','60','70','80','90','95'));
$graph->ygrid->SetFill(false);
//$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME);
$p1 = new LinePlot($datay1);
$graph->Add($p1);
$p2 = new LinePlot($datay2);
$graph->Add($p2);
//$ADR=92.04-5.9;
//$BDR=91.12-6.32;
$p3 = new LinePlot($datay3);
$graph->Add($p3);
$p4 = new LinePlot($datay4);
$graph->Add($p4);
$p1->SetColor("#55bbdd");
$p1->SetLegend('C50');
$p1->mark->SetType(MARK_FILLEDCIRCLE,'',1.0);
$p1->mark->SetColor('#55bbdd');
$p1->mark->SetFillColor('#55bbdd');
$p1->SetCenter();
$p2->SetColor("#fcbffb");
$p2->SetLegend('MC50');
$p2->mark->SetType(MARK_UTRIANGLE,'',1.0);
$p2->mark->SetColor('#fcbffb');
$p2->mark->SetFillColor('#fcbffb');
$p2->value->SetMargin(14);
$p2->SetCenter();
$p3->SetColor("#dce72a");
$p3->SetLegend('Y50');
$p3->mark->SetType(MARK_DIAMOND,'',1.0);
$p3->mark->SetColor('#dce72a');
$p3->mark->SetFillColor('#dce72a');
$p3->value->SetMargin(14);
$p3->SetCenter();
$p4->SetColor("#aaaaaa");
$p4->SetLegend('Y50');
$p4->mark->SetType(MARK_DIAMOND,'',1.0);
$p4->mark->SetColor('#aaaaaa');
$p4->mark->SetFillColor('#aaaaaa');
$p4->value->SetMargin(14);
$p4->SetCenter();
$sline = new PlotLine(HORIZONTAL,1.5,'#146f02',1.1);
$sline->SetLineStyle('dashed');
$sline->SetLegend("Level A");
$sline2 = new PlotLine(HORIZONTAL,2,'black',1.1);
$sline2->SetLineStyle('dashed');
$sline2->SetLegend("Level B");
$sline3 = new PlotLine(HORIZONTAL,2.5,'red',1.1);
$sline3->SetLineStyle('dashed');
$sline3->SetLegend("Level C");
$graph->Add($sline);
$graph->Add($sline2);
$graph->Add($sline3);
$graph->legend->SetFrameWeight(1);
$graph->legend->SetColor('#4E4E4E','#00A78A');
$graph->legend->SetMarkAbsSize(8);
// Output line
$graph->Stroke($CMYK50N);
?>
<img src=<?php echo $CMYK50N;?>>
</div></td>
<td><div align="center">
<?php // content="text/plain; charset=utf-8"
//require_once ('../jpgraph/jpgraph.php');
$CMYK50_TN="./image/".$imgID."-CMYK50_T.png";
require_once ('../jpgraph/jpgraph_line.php');
require_once ('../jpgraph/jpgraph_line.php');
require_once ('../jpgraph/jpgraph_plotline.php');
//unlink('CMYK50_T.png');
$datay1 = array($TVIc1,$TVIc2,$TVIc3,$TVIc4,$TVIc5,$TVIc6,$TVIc7,$TVIc8,$TVIc9,$TVIc10,$TVIc11,$TVIc12,$TVIc13,$TVIc14,$TVIc15,$TVIc16,$TVIc17,$TVIc18,$TVIc19,$TVIc20);
$datay2 = array($TVIm1,$TVIm2,$TVIm3,$TVIm4,$TVIm5,$TVIm6,$TVIm7,$TVIm8,$TVIm9,$TVIm10,$TVIm11,$TVIm12,$TVIm13,$TVIm14,$TVIm15,$TVIm16,$TVIm17,$TVIm18,$TVIm19,$TVIm20);
$datay3 = array($TVIy1,$TVIy2,$TVIy3,$TVIy4,$TVIy5,$TVIy6,$TVIy7,$TVIy8,$TVIy9,$TVIy10,$TVIy11,$TVIy12,$TVIy13,$TVIy14,$TVIy15,$TVIy16,$TVIy17,$TVIy18,$TVIy19,$TVIy20);
$datay4 = array($TVIk1,$TVIk2,$TVIk3,$TVIk4,$TVIk5,$TVIk6,$TVIk7,$TVIk8,$TVIk9,$TVIk10,$TVIk11,$TVIk12,$TVIk13,$TVIk14,$TVIk15,$TVIk16,$TVIk17,$TVIk18,$TVIk19,$TVIk20);
// Setup the graph
$graph = new Graph(550,430);
$graph->SetScale("linint");
$theme_class= new UniversalTheme;
$graph->SetTheme($theme_class);
$graph->title->Set('CMYK 50 TVI');
$graph->SetBox(false);
$graph->yaxis->HideZeroLabel();
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);
$graph->xaxis->title->Set("Sample ID");
$graph->yaxis->title->Set("TVI");
//$graph->xaxis->SetTickLabels(array('0','5','10','20','30','40','50','60','70','80','90','95'));
$graph->ygrid->SetFill(false);
//$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME);
$p1 = new LinePlot($datay1);
$graph->Add($p1);
$p2 = new LinePlot($datay2);
$graph->Add($p2);
//$ADR=92.04-5.9;
//$BDR=91.12-6.32;
$p3 = new LinePlot($datay3);
$graph->Add($p3);
$p4 = new LinePlot($datay4);
$graph->Add($p4);
$p1->SetColor("#55bbdd");
$p1->SetLegend('C50');
$p1->mark->SetType(MARK_FILLEDCIRCLE,'',1.0);
$p1->mark->SetColor('#55bbdd');
$p1->mark->SetFillColor('#55bbdd');
$p1->SetCenter();
$p2->SetColor("#fcbffb");
$p2->SetLegend('MC50');
$p2->mark->SetType(MARK_UTRIANGLE,'',1.0);
$p2->mark->SetColor('#fcbffb');
$p2->mark->SetFillColor('#fcbffb');
$p2->value->SetMargin(14);
$p2->SetCenter();
$p3->SetColor("#dce72a");
$p3->SetLegend('Y50');
$p3->mark->SetType(MARK_DIAMOND,'',1.0);
$p3->mark->SetColor('#dce72a');
$p3->mark->SetFillColor('#dce72a');
$p3->value->SetMargin(14);
$p3->SetCenter();
$p4->SetColor("#aaaaaa");
$p4->SetLegend('Y50');
$p4->mark->SetType(MARK_DIAMOND,'',1.0);
$p4->mark->SetColor('#aaaaaa');
$p4->mark->SetFillColor('#aaaaaa');
$p4->value->SetMargin(14);
$p4->SetCenter();
$graph->legend->SetFrameWeight(1);
$graph->legend->SetColor('#4E4E4E','#00A78A');
$graph->legend->SetMarkAbsSize(8);
// Output line
$graph->Stroke($CMYK50_TN);
?>
<img src=<?php echo $CMYK50_TN;?>>
</div></td>
</tr>
</table>
<p>
<table width="200" border="1" align="center">
<tr>
<td><div align="center">
<?php // content="text/plain; charset=utf-8"
//require_once ('../jpgraph/jpgraph.php');
$grayN="./image/".$imgID."-gray.png";
require_once ('../jpgraph/jpgraph_line.php');
require_once ('../jpgraph/jpgraph_plotline.php');
//unlink('gray.png');
$datay1 = array($deg1,$deg2,$deg3,$deg4,$deg5,$deg6,$deg7,$deg8,$deg9,$deg10,$deg11,$deg12,$deg13,$deg14,$deg15,$deg16,$deg17,$deg18,$deg19,$deg20);
// Setup the graph
$graph = new Graph(550,430);
$graph->SetScale("textint",0,6,0,0);
$theme_class= new UniversalTheme;
$graph->SetTheme($theme_class);
$graph->title->Set('50/40/40');
$graph->SetBox(false);
$graph->yaxis->HideZeroLabel();
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);
$graph->xaxis->title->Set("Sample ID");
$graph->yaxis->title->Set("de00");
//$graph->xaxis->SetTickLabels(array('0','5','10','20','30','40','50','60','70','80','90','95'));
$graph->ygrid->SetFill(false);
//$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME);
$p1 = new LinePlot($datay1);
$graph->Add($p1);
$p1->SetColor("#aaaaaa");
$p1->SetLegend('50/40/40');
$p1->mark->SetType(MARK_FILLEDCIRCLE,'',1.0);
$p1->mark->SetColor('#aaaaaa');
$p1->mark->SetFillColor('#aaaaaa');
$p1->SetCenter();
$sline = new PlotLine(HORIZONTAL,3,'#146f02',1.1);
$sline->SetLineStyle('dashed');
$sline->SetLegend("Level A");
$sline2 = new PlotLine(HORIZONTAL,3.5,'black',1.1);
$sline2->SetLineStyle('dashed');
$sline2->SetLegend("Level b");
$sline3 = new PlotLine(HORIZONTAL,5,'red',1.1);
$sline3->SetLineStyle('dashed');
$sline3->SetLegend("Level c");
$graph->Add($sline);
$graph->Add($sline2);
$graph->Add($sline3);
$graph->legend->SetFrameWeight(1);
$graph->legend->SetColor('#4E4E4E','#00A78A');
$graph->legend->SetMarkAbsSize(8);
// Output line
$graph->Stroke($grayN);
?>
<img src=<?php echo $grayN;?>>
</div></td>
<td><div align="center">
<?php // content="text/plain; charset=utf-8"
//require_once ('../jpgraph/jpgraph.php');
$gray_DN="./image/".$imgID."-gray_D.png";
require_once ('../jpgraph/jpgraph_line.php');
require_once ('../jpgraph/jpgraph_plotline.php');
//unlink('gray_D.png');
$datay1 = array($mg1D,$mg2D,$mg3D,$mg4D,$mg5D,$mg6D,$mg7D,$mg8D,$mg9D,$mg10D,$mg11D,$mg12D,$mg13D,$mg14D,$mg15D,$mg16D,$mg17D,$mg18D,$mg19D,$mg20D);
// Setup the graph
$graph = new Graph(550,430);
$graph->SetScale("linint");
$theme_class= new UniversalTheme;
$graph->SetTheme($theme_class);
$graph->title->Set('50/40/40');
$graph->SetBox(false);
$graph->yaxis->HideZeroLabel();
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);
$graph->xaxis->title->Set("Sample ID");
$graph->yaxis->title->Set("Density");
//$graph->xaxis->SetTickLabels(array('0','5','10','20','30','40','50','60','70','80','90','95'));
$graph->ygrid->SetFill(false);
//$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME);
$p1 = new LinePlot($datay1);
$graph->Add($p1);
$p1->SetColor("#aaaaaa");
$p1->SetLegend('50/40/40');
$p1->mark->SetType(MARK_FILLEDCIRCLE,'',1.0);
$p1->mark->SetColor('#aaaaaa');
$p1->mark->SetFillColor('#aaaaaa');
$p1->SetCenter();
$graph->legend->SetFrameWeight(1);
$graph->legend->SetColor('#4E4E4E','#00A78A');
$graph->legend->SetMarkAbsSize(8);
// Output line
$graph->Stroke($gray_DN);
?>
<img src=<?php echo $gray_DN;?>>
</div></td>
</tr>
</table>
<br>
<?php
$connection = mysql_connect("127.0.0.1", "root", "fredsql") or die ("Unable to connect!");
mysql_query("SET NAMES 'utf8'");
$db = "tvicheck-st";
// select database
mysql_select_db($db) or die ("Unable to select database!");
// generate and execute query
$query = "INSERT INTO psaProduction2 (po, sNo, filename, target, ddate, pdate, press, paper, ink , cmmt, decc,dem,dey, dek, dec50,dem50, dey50,dek50,deg ) VALUES( '$po', '$sNo', '$filename', '$target', NOW(), '$date_s', '$press', '$paper', '$ink', '$cmmt', '$dec','$dem', '$dey', '$dek', '$dec50', '$dem50', '$dey50', '$dek50', '$deg')";
//$query = "INSERT INTO psaProduction (po, filename, ddate, pdate, press, paper, ink , dec, dem, dey, dek, dec50, dem50, dey50, dek50, deg) VALUES( '$po', '$filename', NOW(), '$date_s', '$press', '$paper', '$ink', '$dec', '$dem', '$dey', '$dek', '$dec50', '$dem50', '$dey50', '$dek50', '$deg')";
//echo $query;
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
mysql_close($connection);
}} ?>
<tr>
<td align="center"><font size="-2"> © <a href="mailto:[email protected]">Fred Kuo</a>, 2014. All rights reserved.<br><a href="http://www.fredkuo.idv.tw/wordpress/?p=1025">Read more.</a><br>
</td>
</tr>
</body>
</html>