indexing description: "[ Cosine function ]" author: "" date: "$Date$" revision: "$Revision$" class COSINE_SOURCE inherit EM_VIZ_SAMPLE_SOURCE_1D EM_VIZ_MATH create make feature -- Initialization make is -- do amplitude := 1.0 x_offset := 0.0 y_offset := 0.0 period := 2*Pi end feature -- Access amplitude: DOUBLE -- Amplitude of cosine x_offset: DOUBLE -- Offset of cosine in x y_offset: DOUBLE -- Offset of cosine in y period: DOUBLE -- Period of cosine feature -- Element change set_amplitude (v: like amplitude) is -- Setter do amplitude := v end set_x_offset (v: like x_offset) is -- Setter do x_offset := v end set_y_offset (v: like y_offset) is -- Setter do y_offset := v end set_period (v: like period) is -- Setter do period := v end feature -- Basic operations sample (pos: DOUBLE): DOUBLE is -- do Result := amplitude * cosine (2*Pi/period * pos + x_offset) + y_offset end end