Skip to content

Commit

Permalink
small adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
tizayi committed Nov 22, 2023
1 parent a0a62ad commit 83f2708
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/calculations/ray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ export class Ray {
}

/**
* Find where the ray insects with a circle.
* Use quadratic formula to find the intersection of this ray and a circle in 2d.
* @param radius radius of the circle
* @param centre centre of the circle
* @returns
*/
public getCircleIntersectionParameterRange(
radius: number,
Expand Down
11 changes: 8 additions & 3 deletions src/plot/centrePlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,18 @@ import {
import { color2String } from "./plotUtils";

export default function CentrePlot(): JSX.Element {

const plotConfig = usePlotStore();

const beamlineConfig = useBeamlineConfigStore<BeamlineConfig>((state) => {
let angle = state.angle;
let wavelength = state.wavelength;

if (wavelength && state.wavelengthUnits === WavelengthUnits.angstroms) {
wavelength = angstroms2Nanometres(wavelength);
}

if (angle && state.angleUnits === AngleUnits.degrees) {
angle = MathUtils.degToRad(angle);
}

return {
angle: angle,
cameraLength: state.cameraLength,
Expand Down Expand Up @@ -87,6 +86,12 @@ export default function CentrePlot(): JSX.Element {
);

const { ptMin, ptMax, visibleQRange, fullQRange } = qrangeResult;




// Best way to do this????????

const adjustUnitsDetector = (detector: Detector): Detector => {
if (plotConfig.plotAxes === PlotAxes.milimeter) {
return {
Expand Down
2 changes: 2 additions & 0 deletions src/plot/legendBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
Card,
CardContent,
Checkbox,
Divider,
FormControl,
FormControlLabel,
FormGroup,
Expand All @@ -22,6 +23,7 @@ export default function LegendBar(): JSX.Element {
<CardContent>
<Stack spacing={1}>
<Typography variant="h6"> Legend</Typography>
<Divider />
<FormGroup>
<FormControlLabel
control={
Expand Down

0 comments on commit 83f2708

Please sign in to comment.