Solved

RANG operand / RAYN(x) Function

  • 10 February 2023
  • 5 replies
  • 639 views

Dear Community,

I am looking for an Operand or ZPL function to get the angle between incident ray and local z-axis of the ray-surface intercept.  Can I use RANG Operand / RAYN() ? or the “ray” mentioned in the defintion of these operand and funtion is the refracted ray.  Thanks in advance.

 

icon

Best answer by Jeff.Wilde 10 February 2023, 21:09

View original

5 replies

Userlevel 7
Badge +2

Hi Jacob,

 

RANG is the angle of the refracted ray. I suspect this is the same for RAYN. RAID will give you the incidence angle with respect to the surface normal:

RAID

Real ray angle of incidence. This is the angle in degrees between the surface normal and the incident ray at the surface defined by Surf at the wavelength defined by Wave. Note the angle of incidence is always positive. See also RAED.

See “Hx, Hy, Px, and Py”.

Would that work for you?

Take care,


David

Hi @David.Nguyen ,

Thanks for the reply and bring in more clarity about the ray used in RANG and RAYN(). 

RAID is calculated with respect to the normal. What i am looking for is an operand or a function that could give me the angle that the incident ray would make with the local Z-axis. Please share if you have came across some operand/function that would satisfy my need. Thanks in advance. 

Userlevel 7
Badge +2

Well, it is a bit convoluted but NORX, NORY, and NORZ will give you the components (along X, Y, and Z respectively) of the surface normal. If you set the If Global flag to zero, you’ll have the coordinates in the surface local axis. If you know the angle of the ray with the surface normal, and you know the surface normal components. You should be able to find your angle. Let me know if you don’t manage. There might be another way, but that’s all I can think about right now.

Take care,


David

Userlevel 7
Badge +3

@Jacob.Jikku:

Maybe I’m missing something, but can’t you just utilize RANG with the surface number *prior* to your surface of interest?  You could also insert a dummy surface with zero thickness in front your surface of interest and use RANG with this new dummy surface number (in this case you can pick whatever material you like for the dummy surface, which may or may not be of any use to you).

Regards,

Jeff

@Jeff.Wilde @David.Nguyen 

Thanks guys for the tip. Your help is very much appreciated. 

Reply