Wind Direction time series
Posted: Sun Jul 22, 2007 11:37 am
Introduction:
In many meteorological applications there is a need to display wind direction time series that sometimes looks rather strange (see e.g.
http://webpages.charter.net/hoodriverwe ... inddir.gif
and http://www.cimms.ou.edu/ARM/wdir.gif).
The problem obviously appears around 0°.
As any angular quantity wind direction has no discontinuity when goes through 0°. However, it’s not the case when wind direction is displayed in XY-coordinates.
To illustrate the problem I plotted in Excel a function y=atan2(1,sin(t)) in LineSeries way
(full view).
A solution could be “wrapping” line around 0°. If I calculate frequent intermediate points and draw them as PointSeries it looks more adequate
(full view).
That is when difference between two adjacent points exceeds 180° it’s actually necessary to draw two lines between them: one line from previous point to 0° (or 360° if the first point is less than 180°) and the next line from 360° (or 0° if the second point is less than 180°) to the second point.
I manually simulated supposed outlook of hypothetic WindDirectionLineSeries:
(full view).
Question:
I have TeeChart Standard v8 without source code. Which TLineSeries method can I override to introduce desired behavior of line drawing?
In many meteorological applications there is a need to display wind direction time series that sometimes looks rather strange (see e.g.
http://webpages.charter.net/hoodriverwe ... inddir.gif
and http://www.cimms.ou.edu/ARM/wdir.gif).
The problem obviously appears around 0°.
As any angular quantity wind direction has no discontinuity when goes through 0°. However, it’s not the case when wind direction is displayed in XY-coordinates.
To illustrate the problem I plotted in Excel a function y=atan2(1,sin(t)) in LineSeries way
(full view).
A solution could be “wrapping” line around 0°. If I calculate frequent intermediate points and draw them as PointSeries it looks more adequate
(full view).
That is when difference between two adjacent points exceeds 180° it’s actually necessary to draw two lines between them: one line from previous point to 0° (or 360° if the first point is less than 180°) and the next line from 360° (or 0° if the second point is less than 180°) to the second point.
I manually simulated supposed outlook of hypothetic WindDirectionLineSeries:
(full view).
Question:
I have TeeChart Standard v8 without source code. Which TLineSeries method can I override to introduce desired behavior of line drawing?