-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
48 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
import Vector2D from "./vector"; | ||
|
||
/** | ||
* Represents devices which have a circular profile such as a beam stop or camera | ||
*/ | ||
export interface CircularDevice { | ||
centre: Vector2D; | ||
diameter: number; | ||
} | ||
|
||
// rememeber i wont make beamstop or camera tube classes as they both just implement circular device | ||
|
||
// this exists so that we can keep a record of the diameter in both mm diameter and px diameter | ||
|
||
// think about quantitiy | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { expect, test } from "vitest"; | ||
import { Ray } from "./ray"; | ||
import Vector2D from "./vector"; | ||
|
||
test("Getting a point from a ray", () => { | ||
const ray1 = new Ray(new Vector2D(1, 1), new Vector2D(1, 1)); | ||
const vector1 = ray1.getPoint(5) | ||
const vector2 = new Vector2D(6, 6) | ||
expect(vector1?.equals(vector2)) | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters