public static GetFileNameWithoutExtension ( string fileName ) : string | ||
fileName | string | |
리턴 | string |
static void Main() { IMathUtility mathUtility = new MathUtils(); IFileUtility fileUtility = new FileUtils(); Console.WriteLine(fileUtility.GetFileExtension("example")); Console.WriteLine(fileUtility.GetFileExtension("example.pdf")); Console.WriteLine(fileUtility.GetFileExtension("example.new.pdf")); Console.WriteLine(fileUtility.GetFileNameWithoutExtension("example")); Console.WriteLine(fileUtility.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(fileUtility.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine( "Distance in the 2D space = {0:f2}", mathUtility.CalcDistance2D(1, -2, 3, 4)); Console.WriteLine( "Distance in the 3D space = {0:f2}", mathUtility.CalcDistance3D(5, 2, -1, 3, -6, 4)); mathUtility.Width = 3; mathUtility.Height = 4; mathUtility.Depth = 5; Console.WriteLine("Volume = {0:f2}", mathUtility.CalcVolume()); Console.WriteLine("Diagonal XYZ = {0:f2}", mathUtility.CalcDiagonalXYZ()); Console.WriteLine("Diagonal XY = {0:f2}", mathUtility.CalcDiagonalXY()); Console.WriteLine("Diagonal XZ = {0:f2}", mathUtility.CalcDiagonalXZ()); Console.WriteLine("Diagonal YZ = {0:f2}", mathUtility.CalcDiagonalYZ()); }
static void Main() { Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine("Distance in the 2D space = {0:f2}", Space3d.CalcDistance2D(1, -2, 3, 4)); Console.WriteLine("Distance in the 3D space = {0:f2}", Space3d.CalcDistance3D(5, 2, -1, 3, -6, 4)); Space3d figure = new Space3d(); figure.Width = 3; figure.Height = 4; figure.Depth = 5; Console.WriteLine("Volume = {0:f2}", figure.CalcVolume()); Console.WriteLine("Diagonal XYZ = {0:f2}", figure.CalcDiagonalXYZ()); Console.WriteLine("Diagonal XY = {0:f2}", figure.CalcDiagonalXY()); Console.WriteLine("Diagonal XZ = {0:f2}", figure.CalcDiagonalXZ()); Console.WriteLine("Diagonal YZ = {0:f2}", figure.CalcDiagonalYZ()); }
static void Main() { Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf") + "\n"); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); var pointA = new Point(1, -2); var pointB = new Point(3, 4); var pointC = new Point(-6, 4); Console.WriteLine("\nDistance in the 2D space = {0:f2}", GeometryUtils.CalcDistance2D(pointA, pointB)); Console.WriteLine("Distance in the 3D space = {0:f2}", GeometryUtils.CalcDistance3D(pointA, pointB, pointC)); var prism = new RectangularParallelepiped(3, 4, 5); Console.WriteLine("\nVolume = {0:f2}", prism.CalcVolume()); Console.WriteLine("Diagonal XYZ = {0:f2}", prism.CalcDiagonalXYZ()); Console.WriteLine("Diagonal XY = {0:f2}", prism.CalcDiagonalXY()); Console.WriteLine("Diagonal XZ = {0:f2}", prism.CalcDiagonalXZ()); Console.WriteLine("Diagonal YZ = {0:f2}", prism.CalcDiagonalYZ()); }
static void Main() { Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.File")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine("Distance in the 2D space = {0:f2}", GeometryUtils.CalcDistance2D(1, -2, 3, 4)); Console.WriteLine("Distance in the 3D space = {0:f2}", GeometryUtils.CalcDistance3D(5, 2, -1, 3, -6, 4)); double width = 3; double height = 4; double depth = 5; var rectangle = new RectangularParallelepiped(width, height, depth); Console.WriteLine("Volume = {0:f2}", rectangle.CalcVolume()); Console.WriteLine("Diagonal XYZ = {0:f2}", rectangle.CalcDiagonalXYZ()); Console.WriteLine("Diagonal XY = {0:f2}", rectangle.CalcDiagonalXY()); Console.WriteLine("Diagonal XZ = {0:f2}", rectangle.CalcDiagonalXZ()); Console.WriteLine("Diagonal YZ = {0:f2}", rectangle.CalcDiagonalYZ()); }
public static void Main() { Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine("Distance in the 2D space = {0:f2}", Geometry2DUtils.CalcDistance(1, -2, 3, 4)); Console.WriteLine("Distance in the 3D space = {0:f2}", Geometry3DUtils.CalcDistance(5, 2, -1, 3, -6, 4)); var parallelepiped = new Parallelepiped(3, 4, 5); Console.WriteLine("Volume = {0:f2}", parallelepiped.CalcVolume()); var diagonalXYZ = Geometry3DUtils.CalcDistance(0, 0, 0, parallelepiped.Width, parallelepiped.Height, parallelepiped.Depth); Console.WriteLine("Diagonal XYZ = {0:f2}", diagonalXYZ); var diagonalXY = Geometry2DUtils.CalcDistance(0, parallelepiped.Width, 0, parallelepiped.Height); Console.WriteLine("Diagonal XY = {0:f2}", diagonalXY); var diagonalXZ = Geometry2DUtils.CalcDistance(0, parallelepiped.Width, 0, parallelepiped.Depth); Console.WriteLine("Diagonal XZ = {0:f2}", diagonalXZ); var diagonalYZ = Geometry2DUtils.CalcDistance(0, parallelepiped.Height, 0, parallelepiped.Depth); Console.WriteLine("Diagonal YZ = {0:f2}", diagonalYZ); }
public static void Main() { Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine("Distance in the 2D space = {0:f2}", Utils2D.CalculateDistance(1, -2, 3, 4)); Console.WriteLine("Distance in the 3D space = {0:f2}", Utils3D.CalculateDistance(5, 2, -1, 3, -6, 4)); double width = 3; double height = 4; double depth = 5; Console.WriteLine("Volume in 3D = {0:f2}", Utils3D.CalculateVolume(width, height, depth)); Console.WriteLine("Diagonal in 3D = {0:f2}", Utils3D.CalculateDiagonal(width, height, depth)); Console.WriteLine("Diagonal (XY) in 2D = {0:f2}", Utils2D.CalculateDiagonal(width, height)); Console.WriteLine("Diagonal (XZ) in 2D = {0:f2}", Utils2D.CalculateDiagonal(height, depth)); Console.WriteLine("Diagonal (YZ) in 2D = {0:f2}", Utils2D.CalculateDiagonal(width, depth)); Console.WriteLine("Volume in 3D = {0}", Utils3D.CalculateVolume(5, 3, 7)); }
private static void FileUtileExamples() { var fileNames = new string[] { "example", "example.pdf", "example.new.pdf" }; foreach (var fileName in fileNames) { try { var fileExtension = FileUtils.GetFileExtension(fileName); Console.WriteLine($"File extension of \"{fileName}\" is: {fileExtension}"); } catch (ArgumentException ex) { Console.WriteLine(ex.Message); } } foreach (var fileName in fileNames) { try { var nameWithoutExtension = FileUtils.GetFileNameWithoutExtension(fileName); Console.WriteLine($"File name without extension from \"{fileName}\" is: {nameWithoutExtension}"); } catch (ArgumentException ex) { Console.WriteLine(ex.Message); } } }
static void Main() { var fileNames = new string[] { "example", "example.pdf", "example.new.pdf" }; foreach (var fileName in fileNames) { string fileExtension = FileUtils.GetFileExtension(fileName); string fileNameWithoutExtension = FileUtils.GetFileNameWithoutExtension(fileName); Console.WriteLine(fileExtension); Console.WriteLine(fileNameWithoutExtension); } Console.WriteLine("Distance in the 2D space = {0:f2}", GeometryUtils.CalcDistance2D(1, -2, 3, 4)); Console.WriteLine("Distance in the 3D space = {0:f2}", GeometryUtils.CalcDistance3D(5, 2, -1, 3, -6, 4)); Parallelepiped parallelepiped = new Parallelepiped(3, 4, 5); double paralVolume = parallelepiped.CalcVolume(); double paralBodyDiagonal = parallelepiped.CalcBodyDiagonal(); double paralDiagonalXY = parallelepiped.CalcDiagonalXY(); double paralDiagonalXZ = parallelepiped.CalcDiagonalXZ(); double paralDiagonalYZ = parallelepiped.CalcDiagonalYZ(); Console.WriteLine("Volume = {0:f2}", paralVolume); Console.WriteLine("Diagonal XYZ = {0:f2}", paralBodyDiagonal); Console.WriteLine("Diagonal XY = {0:f2}", paralDiagonalXY); Console.WriteLine("Diagonal XZ = {0:f2}", paralDiagonalXZ); Console.WriteLine("Diagonal YZ = {0:f2}", paralDiagonalYZ); }
public static void Main() { Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Point pointA = new Point(1, -2); Point pointB = new Point(3, 4); double distanceAB = Utils.CalcDistance(pointA, pointB); Console.WriteLine("Distance in the 2D space = {0:f2}", distanceAB); Point pointM = new Point(5, 2, -1); Point pointN = new Point(3, -6, 4); double distanceMN = Utils.CalcDistance(pointM, pointN); Console.WriteLine("Distance in the 3D space = {0:f2}", distanceMN); Utils.Width = 3; Utils.Height = 4; Utils.Depth = 5; Console.WriteLine("Volume = {0:f2}", Utils.CalcVolume()); Console.WriteLine("Diagonal XYZ = {0:f2}", Utils.CalcDiagonalXYZ()); Console.WriteLine("Diagonal XY = {0:f2}", Utils.CalcDiagonalXY()); Console.WriteLine("Diagonal XZ = {0:f2}", Utils.CalcDiagonalXZ()); Console.WriteLine("Diagonal YZ = {0:f2}", Utils.CalcDiagonalYZ()); }
public static void Main() { Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine( "Distance in the 2D space = {0:f2}", GeometryUtils.CalcDistance2D(1, -2, 3, 4)); Console.WriteLine( "Distance in the 3D space = {0:f2}", GeometryUtils.CalcDistance3D(5, 2, -1, 3, -6, 4)); var figure = new RectangularSolid(3, 4, 5); Console.WriteLine("Volume = {0:f2}", figure.CalcVolume()); Console.WriteLine("Diagonal XYZ = {0:f2}", figure.CalcDiagonalXYZ()); Console.WriteLine("Diagonal XY = {0:f2}", figure.CalcDiagonalXY()); Console.WriteLine("Diagonal XZ = {0:f2}", figure.CalcDiagonalXZ()); Console.WriteLine("Diagonal YZ = {0:f2}", figure.CalcDiagonalYZ()); }
public static void Main() { Console.WriteLine(FileUtils.GetFileExtension("example.")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine( "Distance in the 2D space = {0:f2}", GeometryUtils.CalcDistance2D(1, -2, 3, 4)); Console.WriteLine( "Distance in the 3D space = {0:f2}", GeometryUtils.CalcDistance3D(5, 2, -1, 3, -6, 4)); Parallelepiped parallelepiped = new Parallelepiped(3, 4, 5); Console.WriteLine("Volume = {0:f2}", parallelepiped.CalcVolume()); Console.WriteLine("Diagonal XYZ = {0:f2}", parallelepiped.CalcDiagonalXYZ()); Console.WriteLine("Diagonal XY = {0:f2}", parallelepiped.CalcDiagonalXY()); Console.WriteLine("Diagonal XZ = {0:f2}", parallelepiped.CalcDiagonalXZ()); Console.WriteLine("Diagonal YZ = {0:f2}", parallelepiped.CalcDiagonalYZ()); }
public static void Main() { try { Console.WriteLine(FileUtils.GetFileExtension("example")); } catch (ArgumentException ex) { Console.WriteLine(ex.Message); } Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine(); Console.WriteLine( "Distance in the 2D space = {0:f2}", Geometry2DUtils.CalculateDistance2D(1, -2, 3, 4)); Console.WriteLine( "Distance in the 3D space = {0:f2}", Geometry3DUtils.CalculateDistance3D(5, 2, -1, 3, -6, 4)); var point3D = new Point3D(3, 4, 5); Console.WriteLine("Volume = {0:f2}", Geometry3DUtils.CalcVolume(point3D)); Console.WriteLine("Diagonal XYZ = {0:f2}", Geometry3DUtils.CalculateDiagonalXYZ(point3D)); Console.WriteLine("Diagonal XY = {0:f2}", Geometry3DUtils.CalculateDiagonalXY(point3D)); Console.WriteLine("Diagonal XZ = {0:f2}", Geometry3DUtils.CalculateDiagonalXZ(point3D)); Console.WriteLine("Diagonal YZ = {0:f2}", Geometry3DUtils.CalculateDiagonalYZ(point3D)); }
public static void Main() { try { Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); } catch (ArgumentException ex) { Console.WriteLine(ex); } Console.WriteLine("Distance in the 2D space = {0:f2}", Figure3DUtils.CalcDistance2D(1, -2, 3, 4)); Console.WriteLine("Distance in the 3D space = {0:f2}", Figure3DUtils.CalcDistance3D(5, 2, -1, 3, -6, 4)); IFigure3D figure = new Figure3D(3, 4, 5); Console.WriteLine("Volume = {0:f2}", Figure3DUtils.CalcVolume(figure)); Console.WriteLine("Diagonal XYZ = {0:f2}", Figure3DUtils.CalcDiagonalXYZ(figure)); Console.WriteLine("Diagonal XY = {0:f2}", Figure3DUtils.CalcDiagonalXY(figure)); Console.WriteLine("Diagonal XZ = {0:f2}", Figure3DUtils.CalcDiagonalXZ(figure)); Console.WriteLine("Diagonal YZ = {0:f2}", Figure3DUtils.CalcDiagonalYZ(figure)); }
static void Main() { Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine("Distance in the 2D space = {0:f2}", GeometryUtils.CalculateDistance2D(1, -2, 3, 4)); Console.WriteLine("Distance in the 3D space = {0:f2}", GeometryUtils.CalculateDistance3D(5, 2, -1, 3, -6, 4)); int width = 3; int height = 4; int depth = 5; Console.WriteLine("Volume = {0:f2}", GeometryUtils.CalculateVolume(width, height, depth)); Console.WriteLine("Diagonal XYZ = {0:f2}", GeometryUtils.CalculateDiagonal3D(width, height, depth)); Console.WriteLine("Diagonal XY = {0:f2}", GeometryUtils.CalculateDiagonal2D(width, height)); Console.WriteLine("Diagonal XZ = {0:f2}", GeometryUtils.CalculateDiagonal2D(width, depth)); Console.WriteLine("Diagonal YZ = {0:f2}", GeometryUtils.CalculateDiagonal2D(height, depth)); }
public static void Main() { Console.WriteLine(FileUtils.GetFileExtension("example.exe")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine( "Distance in the 2D space = {0:f2}", MathUtils.CalculateDistance2D(1, -2, 3, 4)); Console.WriteLine( "Distance in the 3D space = {0:f2}", MathUtils.CalculateDistance3D(5, 2, -1, 3, -6, 4)); double width = 3; double height = 4; double depth = 5; Console.WriteLine("Volume = {0:f2}", MathUtils.CalculateVolume(width, height, depth)); Console.WriteLine("Diagonal XYZ = {0:f2}", MathUtils.CalculateDiagonalXYZ(width, height, depth)); Console.WriteLine("Diagonal XY = {0:f2}", MathUtils.CalculateDiagonalXY(width, height)); Console.WriteLine("Diagonal XZ = {0:f2}", MathUtils.CalculateDiagonalXZ(width, height)); Console.WriteLine("Diagonal YZ = {0:f2}", MathUtils.CalculateDiagonalYZ(height, height)); }
public static void Main(string[] args) { Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine("Distance in the 2D space = {0:f2}", MathUtils.CalcDistance2D(1, -2, 3, 4)); Console.WriteLine("Distance in the 3D space = {0:f2}", MathUtils.CalcDistance3D(5, 2, -1, 3, -6, 4)); double x = 3; double y = 4; double z = 5; Console.WriteLine("Volume = {0:f2}", MathUtils.CalcVolume(x, y, z)); Console.WriteLine("Diagonal XYZ = {0:f2}", MathUtils.CalcDistance3D(x, y, z)); Console.WriteLine("Diagonal XY = {0:f2}", MathUtils.CalcDistance2D(x, y)); Console.WriteLine("Diagonal XZ = {0:f2}", MathUtils.CalcDistance2D(x, z)); Console.WriteLine("Diagonal YZ = {0:f2}", MathUtils.CalcDistance2D(y, z)); }
private static void Main() { Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine("Distance in the 2D space = {0:f2}", FigureUtils.CalcDistance2D(1, -2, 3, 4)); Console.WriteLine("Distance in the 3D space = {0:f2}", FigureUtils.CalcDistance3D(5, 2, -1, 3, -6, 4)); Parallelepiped.Width = 3; Parallelepiped.Height = 4; Parallelepiped.Depth = 5; Console.WriteLine("Volume = {0:f2}", Parallelepiped.CalcVolume()); Console.WriteLine("Diagonal XYZ = {0:f2}", Parallelepiped.CalcDiagonalXyz()); Console.WriteLine("Diagonal XY = {0:f2}", Parallelepiped.CalcDiagonalXy()); Console.WriteLine("Diagonal XZ = {0:f2}", Parallelepiped.CalcDiagonalXz()); Console.WriteLine("Diagonal YZ = {0:f2}", Parallelepiped.CalcDiagonalYz()); }
public static void Main() { Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine( "Distance in the 2D space = {0:f2}", EuclideanDistanceCalculator.CalcDistance2D(1, -2, 3, 4)); Console.WriteLine( "Distance in the 3D space = {0:f2}", EuclideanDistanceCalculator.CalcDistance3D(5, 2, -1, 3, -6, 4)); var width = 3; var height = 4; var depth = 5; Console.WriteLine("Volume = {0:f2}", CuboidCalculator.CalcVolume(width, height, depth)); Console.WriteLine("Diagonal XYZ = {0:f2}", CuboidCalculator.CalcDiagonalXYZ(width, height, depth)); Console.WriteLine("Diagonal XY = {0:f2}", CuboidCalculator.CalcDiagonalXY(width, height)); Console.WriteLine("Diagonal XZ = {0:f2}", CuboidCalculator.CalcDiagonalXZ(width, height)); Console.WriteLine("Diagonal YZ = {0:f2}", CuboidCalculator.CalcDiagonalYZ(width, height)); }
public static void Main() { IGeometryUtils geometryUtils = new GeometryUtils(); IFileUtils fileUtils = new FileUtils(); string[] fileNames = { "example", "example.pdf", "example.new.pdf" }; foreach (string fileName in fileNames) { try { Console.WriteLine(fileUtils.GetFileExtension(fileName)); } catch (ArgumentException e) { Console.WriteLine(e.Message); } } foreach (string fileName in fileNames) { try { Console.WriteLine(fileUtils.GetFileNameWithoutExtension(fileName)); } catch (ArgumentException e) { Console.WriteLine(e.Message); } } Point2D firstPoint2D = new Point2D(1, -2); Point2D secondPoint2D = new Point2D(3, 4); Console.WriteLine( "Distance in the 2D space = {0:f2}", geometryUtils.CalcDistance2D(firstPoint2D, secondPoint2D)); Point3D firstPoint3D = new Point3D(5, 2, -1); Point3D secondPoint3D = new Point3D(3, -6, 4); Console.WriteLine( "Distance in the 3D space = {0:f2}", geometryUtils.CalcDistance3D(firstPoint3D, secondPoint3D)); double width = 3; double height = 4; double depth = 5; Volume volume = new Volume(width, height, depth); Console.WriteLine("Volume = {0:f2}", volume.CalcVolume()); Console.WriteLine("Diagonal XYZ = {0:f2}", volume.CalcDiagonalXYZ(geometryUtils)); Console.WriteLine("Diagonal XY = {0:f2}", volume.CalcDiagonalXY(geometryUtils)); Console.WriteLine("Diagonal XZ = {0:f2}", volume.CalcDiagonalXZ(geometryUtils)); Console.WriteLine("Diagonal YZ = {0:f2}", volume.CalcDiagonalYZ(geometryUtils)); }
public static void Main() { Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine("Distance in the 2D space = {0:f2}", MathUtils.CalcDistance2D(1, -2, 3, 4)); Console.WriteLine("Distance in the 3D space = {0:f2}", MathUtils.CalcDistance3D(5, 2, -1, 3, -6, 4)); Console.WriteLine("Volume = {0:f2}", FigureUtils.CalcVolume(3, 4, 5)); Console.WriteLine("Diagonal XYZ = {0:f2}", FigureUtils.CalcDiagonalXYZ(3, 4, 5)); Console.WriteLine("Diagonal XY = {0:f2}", FigureUtils.CalcDiagonalXY(3, 4)); Console.WriteLine("Diagonal XZ = {0:f2}", FigureUtils.CalcDiagonalXZ(3, 5)); Console.WriteLine("Diagonal YZ = {0:f2}", FigureUtils.CalcDiagonalYZ(4, 5)); }
static void Main() { Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine("Distance in the 2D space = {0:f2}", GeometryUtils.CalcDistance2D(1, -2, 3, 4)); Console.WriteLine("Distance in the 3D space = {0:f2}", GeometryUtils.CalcDistance3D(5, 2, -1, 3, -6, 4)); Console.WriteLine("Volume = {0:f2}", GeometryUtils.CalcVolume(4, 5, 6)); Console.WriteLine("3D Diagonal = {0:f2}", GeometryUtils.CalcDiagonal3D(5, 2, 8)); Console.WriteLine("2D Diagonal = {0:f2}", GeometryUtils.CalcDiagonal2D(10, 30)); }
public static void Main() { Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine("Distance in the 2D space = {0:f2}", CalculatorUtils.CalcDistance2D(1, -2, 3, 4)); Console.WriteLine("Distance in the 3D space = {0:f2}", CalculatorUtils.CalcDistance3D(5, 2, -1, 3, -6, 4)); Figure figure = new Figure(3, 4, 5); Console.WriteLine("Volume = {0:f2}", CalculatorUtils.CalcVolume(figure.Width, figure.Height, figure.Depth)); Console.WriteLine("Diagonal XYZ = {0:f2}", CalculatorUtils.CalcDiagonalXyz(figure.Width, figure.Height, figure.Depth)); Console.WriteLine("Diagonal XY = {0:f2}", CalculatorUtils.CalcDiagonalXy(figure.Width, figure.Height)); Console.WriteLine("Diagonal XZ = {0:f2}", CalculatorUtils.CalcDiagonalXz(figure.Width, figure.Depth)); Console.WriteLine("Diagonal YZ = {0:f2}", CalculatorUtils.CalcDiagonalYz(figure.Height, figure.Depth)); }
public static void Main() { Console.WriteLine("File Utils testing..."); Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine("OrthoSpace testing..."); OrthogonalSpace3D mySpace = new OrthogonalSpace3D(15, 10, 20); TestSpaceMethods(mySpace); mySpace.Depth = 1; mySpace.Width = 1; mySpace.Height = 1; TestSpaceMethods(mySpace); }
public static void Main() { Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine("Distance in the 2D space = {0:f2}", GeometryUtils.CalcDistance2D(1, -2, 3, 4)); Console.WriteLine("Distance in the 3D space = {0:f2}", GeometryUtils.CalcDistance3D(5, 2, -1, 3, -6, 4)); RectangularPrism prism = new RectangularPrism(3.0, 4.0, 5.0); Console.WriteLine("Volume = {0:f2}", prism.CalcVolume()); Console.WriteLine("Diagonal XYZ = {0:f2}", prism.CalcDiagonalXYZ()); Console.WriteLine("Diagonal XY = {0:f2}", prism.CalcDiagonalXY()); Console.WriteLine("Diagonal XZ = {0:f2}", prism.CalcDiagonalXZ()); Console.WriteLine("Diagonal YZ = {0:f2}", prism.CalcDiagonalYZ()); }
static void Main() { Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine("Distance in the 2D space = {0:f2}", Geometry2DUtils.CalcDistance2D(1, -2, 3, 4)); Console.WriteLine("Distance in the 3D space = {0:f2}", Geometry3DUtils.CalcDistance3D(5, 2, -1, 3, -6, 4)); Figure3D figure = new Figure3D(3, 4, 5); Console.WriteLine("Volume = {0:f2}", Geometry3DUtils.CalcVolume(figure)); Console.WriteLine("Diagonal XYZ = {0:f2}", Geometry3DUtils.CalcDiagonalXYZ(figure)); Console.WriteLine("Diagonal XY = {0:f2}", Geometry3DUtils.CalcDiagonalXY(figure)); Console.WriteLine("Diagonal XZ = {0:f2}", Geometry3DUtils.CalcDiagonalXZ(figure)); Console.WriteLine("Diagonal YZ = {0:f2}", Geometry3DUtils.CalcDiagonalYZ(figure)); }
static void Main() { //Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); //Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine("Distance in the 2D space = {0:f2}", PointUtils.CalcDistance2D(1, -2, 3, 4)); Console.WriteLine("Distance in the 3D space = {0:f2}", PointUtils.CalcDistance3D(5, 2, -1, 3, -6, 4)); FigureUtils figure = new FigureUtils(3, 4, 5); Console.WriteLine("Volume = {0:f2}", figure.CalcVolume()); Console.WriteLine("Diagonal XYZ = {0:f2}", figure.CalcDiagonalXYZ()); Console.WriteLine("Diagonal XY = {0:f2}", figure.CalcDiagonalXY()); Console.WriteLine("Diagonal XZ = {0:f2}", figure.CalcDiagonalXZ()); Console.WriteLine("Diagonal YZ = {0:f2}", figure.CalcDiagonalYZ()); }
public static void Main() { Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine("Distance in the 2D space = {0:f2}", GeometricUtils.CalcDistance2D(1, -2, 3, 4)); Console.WriteLine("Distance in the 3D space = {0:f2}", GeometricUtils.CalcDistance3D(5, 2, -1, 3, -6, 4)); GeometricUtils.Width = 3; GeometricUtils.Height = 4; GeometricUtils.Depth = 5; Console.WriteLine("Volume = {0:f2}", GeometricUtils.CalcVolume()); Console.WriteLine("Diagonal XYZ = {0:f2}", GeometricUtils.CalcDiagonalXYZ()); Console.WriteLine("Diagonal XY = {0:f2}", GeometricUtils.CalcDiagonalXY()); Console.WriteLine("Diagonal XZ = {0:f2}", GeometricUtils.CalcDiagonalXZ()); Console.WriteLine("Diagonal YZ = {0:f2}", GeometricUtils.CalcDiagonalYZ()); }
public static void Main() { //Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); double x1 = 1; double y1 = -2; double x2 = 3; double y2 = 4; Console.WriteLine("Distance in the 2D space = {0:f2}", MathUtils.CalcDistance2D(x1, y1, x2, y2)); x1 = 5; y1 = 2; double z1 = -1; x2 = 3; y2 = -6; double z2 = 4; Console.WriteLine("Distance in the 3D space = {0:f2}", MathUtils.CalcDistance3D(x1, y1, z1, x2, y2, z2)); double width = 3; double height = 4; double depth = 5; Console.WriteLine("Volume = {0:f2}", MathUtils.CalcVolume(width, height, depth)); Console.WriteLine("Diagonal XYZ = {0:f2}", MathUtils.CalcDiagonalXYZ(width, height, depth)); Console.WriteLine("Diagonal XY = {0:f2}", MathUtils.CalcDiagonalXY(width, height)); Console.WriteLine("Diagonal XZ = {0:f2}", MathUtils.CalcDiagonalXZ(width, depth)); Console.WriteLine("Diagonal YZ = {0:f2}", MathUtils.CalcDiagonalYZ(height, depth)); }
static void Main() { Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); Console.WriteLine("Distance in the 2D space = {0:f2}", MathUtils.CalculateDistance2D(1, -2, 3, 4)); Console.WriteLine("Distance in the 3D space = {0:f2}", MathUtils.CalculateDistance3D(5, 2, -1, 3, -6, 4)); ICuboid cuboid = new Cuboid(3, 4, 5); Console.WriteLine("Volume = {0:f2}", cuboid.CalculateVolume()); Console.WriteLine("Diagonal XYZ = {0:f2}", cuboid.CalculateDiagonalXYZ()); Console.WriteLine("Diagonal XY = {0:f2}", cuboid.CalculateDiagonalXY()); Console.WriteLine("Diagonal XZ = {0:f2}", cuboid.CalculateDiagonalXZ()); Console.WriteLine("Diagonal YZ = {0:f2}", cuboid.CalculateDiagonalYZ()); }
public static void Main() { { Console.WriteLine(FileUtils.GetFileExtension("example")); Console.WriteLine(FileUtils.GetFileExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf")); Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf")); } { Console.WriteLine("Distance in the 2D space = {0:F2}", GeometryUtils.CalcDistance2D(1, -2, 3, 4)); Console.WriteLine("Distance in the 3D space = {0:F2}", GeometryUtils.CalcDistance3D(5, 2, -1, 3, -6, 4)); } { RectangularCuboid rectangularCuboid = new RectangularCuboid() { Width = 3, Height = 4, Depth = 5 }; Console.WriteLine("Volume = {0:F2}", rectangularCuboid.Volume); Console.WriteLine("Diagonal XY = {0:F2}", rectangularCuboid.CalcDiagonalXY()); Console.WriteLine("Diagonal YZ = {0:F2}", rectangularCuboid.CalcDiagonalYZ()); Console.WriteLine("Diagonal ZX = {0:F2}", rectangularCuboid.CalcDiagonalZX()); Console.WriteLine("Diagonal XYZ = {0:F2}", rectangularCuboid.CalcDiagonalXYZ()); } }