Skip to content

Commit afd0218

Browse files
committed
add trapezium()
1 parent cd7b819 commit afd0218

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

functionGenerator.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ float funcgen::random_DC()
273273

274274
float funcgen::trapezium1(float t)
275275
{
276+
t += _phase + _period / 8; // zero point for t = 0
276277
if (t < 0)
277278
{
278279
t = -t;
@@ -300,6 +301,7 @@ float funcgen::trapezium1(float t)
300301

301302
float funcgen::trapezium2(float t)
302303
{
304+
t += _phase + _period / 8; // zero point for t = 0
303305
if (t < 0)
304306
{
305307
t = -t;

0 commit comments

Comments
 (0)