=MESSAGEBOX(GetDims(90,1)) FUNCTION GetDims PARAMETERS lnAngle, lnRadius * Improve default accuracy lnOldDecimals = SET('Decimals') SET DECIMALS TO 10 * Convert degrees to radians lnRadAngle = lnAngle*(2*3.14159265358979) / 360 lnChordLength = 2 * lnRadius * SIN(lnRadAngle / 2) lnArcHeight = lnRadius * (1 - COS(lnRadAngle / 2)) lnDist2Centre = lnRadius * COS(lnRadAngle / 2) * Allow for angles > 180 IF lnAngle > 180 lcRectDims = 'The dimensions are '+ALLTRIM(STR(2 * lnRadius, 10, 5))+; ' by '+ALLTRIM(STR(lnArcHeight, 10, 5)) +; ' at '+ALLTRIM(STR(lnDist2Centre, 10, 5)) ELSE lcRectDims = 'The dimensions are '+ALLTRIM(STR(lnChordLength, 10, 5))+; ' by '+ALLTRIM(STR(lnArcHeight, 10, 5)) +; ' at '+ALLTRIM(STR(lnDist2Centre, 10, 5)) ENDIF * Restore old SETs SET DECIMALS TO (lnOldDecimals) RETURN lcRectDims