|
FUNCTION cto2d_determinant_test (cto2d : cartesian_transformation_operator_2d, expected_value : REAL, delta : REAL) : BOOLEAN; LOCAL det : REAL := 0.0 ; drs : LIST [ 4 : 4 ] OF REAL := [ ] ; END_LOCAL ; drs [ 1 ] := cto2d . u [ 1 ] . direction_ratios [ 1 ] ; drs [ 2 ] := cto2d . u [ 1 ] . direction_ratios [ 2 ] ; drs [ 3 ] := cto2d . u [ 2 ] . direction_ratios [ 1 ] ; drs [ 4 ] := cto2d . u [ 2 ] . direction_ratios [ 2 ] ; det := ( drs [ 1 ] * drs [ 4 ] ) - ( drs [ 2 ] * drs [ 3 ] ) ; IF ( ABS ( expected_value - det ) < ABS ( delta ) ) THEN RETURN ( TRUE ) ; ELSE RETURN ( FALSE ) ; END_IF ; END_FUNCTION; -- cto2d_determinant_test |
|
public class FCto2d_determinant_test public static Value run(SdaiContext _context, Value cto2d, Value expected_value, Value delta) |