Skip to content

maxwell-hauser/java_geometric_shapes_2d3d

Repository files navigation

Geometric Shapes 2D/3D

Java Maven License Status

An interactive Java console application for calculating geometric properties of 2D and 3D shapes using coordinate-based and dimension-based inputs.

✨ Features

  • 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

📐 Supported Shapes

Two-Dimensional Shapes

  • 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

Three-Dimensional Shapes

  • Cube: Surface area and volume from edge length
  • Triangular Prism: Surface area and volume from base and height

🚀 Quick Start

Using Maven (Recommended)

# Build the project
mvn clean package

# Run the application
java -jar target/geometric-shapes-2d3d-1.0.1.jar

Without Maven

# Compile all shape classes
javac GeometricShapes2D3D.java Line.java Triangle.java Rectangle.java Diamond.java Cube.java TriangularPrism.java

# Run
java GeometricShapes2D3D

📖 Usage

  1. Launch the application
  2. Select a shape from the numbered menu
  3. Enter coordinates or dimensions as prompted
  4. View calculated properties in dialog boxes
  5. Choose another shape or exit

📋 Requirements

  • JDK 21 (Temurin recommended)
  • Maven 3.9+

🏗️ Building from Source

# 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 test

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

👤 Author

Maxwell Hauser

🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

About

Dialog-based calculator for computing geometric properties of 2D and 3D shapes. Uses JOptionPane for user input and calculates perimeter, area, surface area, and volume for various geometric shapes including triangles, rectangles, diamonds, cubes, and triangular prisms.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages