! @ p_beam &1 ! ! Plots clean-beam for &1% (AAA or other header variable) ! if (&1%major.eq.0) then return endif define real box[4] user[4] poly[4,2] let box[1] box_xmin let box[2] box_ymin let box[3] box_xmax let box[4] box_ymax set box box[1] box[1]+0.2*(box[3]-box[1]) box[2] box[2]+0.2*(box[4]-box[2]) ! let user[1] user_xmin let user[2] user_ymin let user[3] user_xmax let user[4] user_ymax limit user[1] user[1]+0.2*(user[3]-user[1]) user[2] user[2]+0.2*(user[4]-user[2]) let poly user_xmin user_xmax user_xmax user_xmin user_ymin user_ymin user_ymax user_ymax polygon poly /variable polygon /fill 7 ! define double a b c no s ca sa u1[2] v1[2] u2[2] v2[2] u0 v0 define integer hache let u0 user[1]+0.1*(user[3]-user[1]) let v0 user[2]+0.1*(user[4]-user[2]) let hache 3 let a 1+(&1%minor|&1%major)**2 let sa sin(pi|2-&1%pa) let ca cos(pi|2-&1%pa) for i -hache to hache let b i*&1%major|hache let no 0.5*b let c no^2-&1%minor^2|4 let s b*b-4*a*c if (s.gt.0) then let s sqrt(s) let u1[1] (-b+s)|(2*a) let u1[2] (-b-s)|(2*a) let v1 u1+no let u2 (u1*ca-v1*sa)+u0 let v2 (u1*sa+v1*ca)+v0 conn u2 v2 endif next ellipse 0.5*&1%major 0.5*&1%minor 90-180*&1%pa|pi /box abs(box[3]-box[1])*0.1 abs(box[4]-box[2])*0.1 ! box n n n set box box[1] box[3] box[2] box[4] limits user[1] user[3] user[2] user[4]