MethodicalAcceleratorDesign / MAD-X

MAD-X repository
Other
49 stars 39 forks source link

change octagon aperture parameters #674

Closed ldeniau closed 5 years ago

ldeniau commented 6 years ago

The 3rd and 4th parameter are angles, making the check for point inside octagon overcomplicated and somehow inaccurate (see trrun.f90 line 2847). Putting "corner hypothenuse" sizes in ap[3] and ap[4] is consistent with racetrack definition and simpler to check. aperture={apx, apy, dx, dy} where dx,dy are the lengths of the side not parallel to axis, hence the side coordinates are (apx,apy-dy) to (apx-dx, apy) and dy/dx is its slope. the check for the octagon becomes much simpler: outside if x >= ap[1] or y >= ap[2] or y >= (x-(ap[1]-ap[3]))*ap[4]/ap[3] + ap[2] where x and y are taken positive (i.e. absolute value of)

ldeniau commented 6 years ago

This change will be proposed at HSS meeting tomorrow, but the only known user agreed with this better definition.

tpersson commented 5 years ago

After some discussion it was agreed to not go for this change at the moment.