home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Graphics Programming (2nd Edition) / Visual Basic Graphics Programming 2nd Edition.iso / OldSrc / CH7 / SRC / DSINES.CLS < prev    next >
Encoding:
Text File  |  1995-10-26  |  578 b   |  24 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "DistortSines"
  6. Attribute VB_Creatable = False
  7. Attribute VB_Exposed = False
  8. Option Explicit
  9.  
  10. Public amplitude As Single
  11. Public period As Single
  12.  
  13. ' ************************************************
  14. ' Apply a shape distorting transformation to
  15. ' the point.
  16. ' ************************************************
  17. Sub Distort(x As Single, y As Single)
  18. Dim newx As Single
  19.     
  20.     newx = x + amplitude * Sin(y * 6.28 / period)
  21.     y = y + amplitude * Sin(x * 6.28 / period)
  22.     x = newx
  23. End Sub
  24.