Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
uploaded-sys committed Dec 28, 2024
1 parent ac30514 commit e834797
Showing 1 changed file with 75 additions and 14 deletions.
89 changes: 75 additions & 14 deletions mical/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
# Geometric Optics Calculator Tests
# Geometric Optics Calculator

This project contains tests for a geometric optics calculator using Jest testing framework.
A JavaScript calculator for geometric optics calculations with comprehensive test coverage.

## Features

- Angle calculations between objects
- Reflection computations
- Support for:
- Infinite cases (0° angles)
- Symmetric object positions
- Asymmetric object positions
- Edge cases (360° and 180°)

## Prerequisites
- Node.js 14 or higher
- npm 6 or higher
- Required packages:
- jest
- @types/jest

## Installation

1. Make sure you have Node.js installed on your system
2. Clone this repository
3. Install dependencies by running:
1. Clone the repository:
```bash
git clone https://github.com/yourusername/mical.git
cd mical
```

2. Install dependencies:
```bash
npm install
npm install --save-dev jest
```

## Configuration
Expand All @@ -23,6 +43,32 @@ npm install --save-dev jest
}
```

## Usage

### Basic Setup
1. Create your test files in the test directory
2. Run tests with:
```bash
npm test
```

### Advanced Options
- `--coverage` : Generate coverage report
- `--watch` : Watch mode
- `--verbose` : Detailed output

## Examples

1. Basic test run:
```bash
npm test
```

2. With coverage:
```bash
npm test -- --coverage
```

## Running Tests

To run the tests, use one of the following commands:
Expand All @@ -45,12 +91,27 @@ To get test coverage report, run:
npx jest --coverage
```

## Test Structure
## Test Cases

Our test suite covers:

1. Angle Calculations
- Basic angle measurements
- Reflection angles
- Mirror symmetry

2. Position Calculations
- Object distance from mirror
- Image formation
- Symmetric positions

3. Special Cases
- Perpendicular rays
- Parallel rays
- Zero-angle cases

The tests verify various scenarios for the geometric optics calculator:
- Infinite cases (0° angle)
- Symmetric object positions
- Asymmetric object positions
- Odd and even division results
- Negative angles
- Special cases (360° and 180°)
4. Edge Cases
- 360° rotations
- 180° reflections
- Negative angles
- Boundary conditions

0 comments on commit e834797

Please sign in to comment.