MATLAB
```[hitPt_PT, tia, incPos, tiaPT, facetIdx] = ObjectIncidence(G, ...
Targ,[hitPt],[dispPlot]);```

Computes incident angle for a given target and geometry. If Targ has a structure field Object containing facets and vertices, the incidence angle is computed based on those. Otherwise, the incidence angle is computed assuming a missile.

 Parameters Description G [struct] Geometry structure from GeomStruct Targ [struct] Target structure from TargStruct hitPt [array] (Optional) Point on the target for which to compute incidence angle. If size NGeom x 2 it is assumed to be in target P/T coordinates. If size NGeom x 3 it is assumed to be in object coordinates. If not input, uses Targ.Object.hitPoint or Targ.HELpt. dispPlot [logical/char] (Optional) Flag indicating whether to plot the object with the incident ray orientation or an avi file name to write the plot(s) to an avi file. Default is false. Only displayed if Targ.Object exists and the ray is actually incident.
 Return Values Description hitPt_PT [array] Hit point in target P/T coordinates tia [vector] Target incidence angle (rad) incPos [array] Position vector on the target at which the ray is incident in the target object (x,y,z) coordinate frame tiaPT [array] Target incidence angle resolved in target P/T coordinate frame (rad) facetIdx [array] Index into Targ.Object.facets for the facet on which the ray is incident for each geometry

>> Targ = TargStruct('cone',[0.5,2,4]);

>> [~,tia] = ObjectIncidence(GeomStruct,Targ,[0.25 0])

• Compute angle of incidence for a point 0.25m from the tip in P/T coordinates (halfway down the cone)
>> [trkpt,tia] = ObjectIncidence(GeomStruct,Targ,Extract(Targ,'Object.trkPoint'))

• Compute the object track point in target P/T coords and the angle of incidence.

 Copyright (c) 2009. All rights reserved. What do you think about this topic? Send feedback!