HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/xampp/htdocs/PBN/lab2xyz.php
<?php
	# ------- The graph values in the form of associative array
	function lab2xyz($v,$l,$a,$b) {
	
	
	//=IF((($l+16)/116+$a/500)>0.206893,96.422*(($l+16)/116+$a/500)^3,96.422/7.787*((($l+16)/116+$l/500)-16/116))
	
	
	//=IF((($l+16)/116)>0.206893,100*(($l+16)/116)^3,100/7.787*((($l+16)/116)-16/116))
	//$xl=$v;
	
	
	
	if ($v=="x") {
		$xl=$l;
		
		if ((($l+16)/116+$a/500)>0.206893) {
			$x=96.422*pow((($l+16)/116+$a/500),3);}
		else {	
			$x=96.422/7.787*((($l+16)/116+$l/500)-16/116); 
			}
		return $x;	
	}
	
	if ($v=="y") {
		$xl=$l;
		
		if ((($l+16)/116)>0.206893) {
			$y=100*pow((($l+16)/116),3);}
		else {	
			$y=100/7.787*((($l+16)/116)-16/116); 
			}
		return $y;	
	}
//=IF((($l+16)/116-$b/200)>0.206893,82.521*(($l+16)/116-$b/200)^3,82.521/7.787*((($l+16)/116-$b/200)-16/116))
	
	if ($v=="z") {
		$xl=$l;
		
		if ((($l+16)/116-$b/200)>0.206893) {
			$z=82.521*pow((($l+16)/116-$b/200),3);}
		else {	
			$z=82.521/7.787*((($l+16)/116-$b/200)-16/116); 
			}
		return $z;	
	}
}
?>