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)
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)