An interactive Java console application for calculating geometric properties of 2D and 3D shapes using coordinate-based and dimension-based inputs.
- Multiple Shape Types: Support for 6 different geometric shapes
- Comprehensive Calculations: Perimeter, area, surface area, and volume
- Interactive Interface: Menu-driven selection with dialog prompts
- Coordinate-Based Input: Precise calculations using coordinate geometry
- Input Validation: Error handling for invalid inputs
- Loop-Based Operation: Calculate multiple shapes in one session
- Line: Length calculation from two points
- Triangle: Perimeter and area from three vertices
- Rectangle: Perimeter and area from corner coordinates
- Diamond: Perimeter and area from diagonal endpoints
- Cube: Surface area and volume from edge length
- Triangular Prism: Surface area and volume from base and height
# Build the project
mvn clean package
# Run the application
java -jar target/geometric-shapes-2d3d-1.0.1.jar# Compile all shape classes
javac GeometricShapes2D3D.java Line.java Triangle.java Rectangle.java Diamond.java Cube.java TriangularPrism.java
# Run
java GeometricShapes2D3D- Launch the application
- Select a shape from the numbered menu
- Enter coordinates or dimensions as prompted
- View calculated properties in dialog boxes
- Choose another shape or exit
- JDK 21 (Temurin recommended)
- Maven 3.9+
# Clone the repository
git clone https://github.com/maxwell-hauser/java_geometric_shapes_2d3d.git
cd java_geometric_shapes_2d3d
# Build with Maven
mvn clean install
# Run tests
mvn testThis project is licensed under the MIT License - see the LICENSE file for details.
Maxwell Hauser
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.