public static Double computeAspect ( Geometry geometry ) throws IllegalArgumentException { if ( geometry == null ) { return null ; } Vector3D vector = TriMarkers . getSteepestVector ( TriMarkers . getNormalVector ( TINFeatureFactory . createTriangle ( geometry ) ) , TINFeatureFactory . EPSILON ) ; if ( vector . length ( ) < TINFeatureFactory . EPSILON ) { return 0d ; } else { Vector2D v = new Vector2D ( vector . getX ( ) , vector . getY ( ) ) ; return measureFromNorth ( Math . toDegrees ( v . angle ( ) ) ) ; } }
Compute the aspect in degree . The geometry must be a triangle .