SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Drawing a Fractal using HPGL



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dialog Programming -> Graphics
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Mon Feb 25, 2008 1:15 pm    Post subject: Drawing a Fractal using HPGL Reply with quote

Code:
report zexp_fract.
***********************************************************
* Draw a little fractal using HPGL GUI, just for fun
*   Pretty old stuff
*
*   This is freeware. Please read the terms of use.
*   Written by Urs Rohner, Rohner IT Consulting & Engineering
*
*   Contact Author: Urs Rohner
*
***********************************************************

* Selection Screen
  parameters:
    _lim type i default '0'.

* Globals
  data:
    _cnt type i,
    _s1  type f, _s2  type f, _s3  type f,
    _a1  type f, _a2  type f, _a3  type f,
    begin of _vect occurs 9841,
      c(28),
    end of _vect.

* P A I ( )
  start-of-selection.
     move:
      ' 0.35' to _s1, '-0.48' to _a1,
      ' 0.87' to _s2, '-0.21' to _a2,
      ' 0.39' to _s3, ' 0.10' to _a3.

    _vect-c = 'PA.....,.....PD.....,.....PU'.
    append _vect.
    perform t using 15 30 45 '1.1' 0.
    call function 'GRAPH_HPGL' tables data = _vect.
    write: / 'Number of Calls', _cnt.



  form t using value(x) value(y) value(l) value(a) value(d) type i.
    data:
      x_ type f, y_ type f, l_ type f, a_ type f, ic type i.

    add 1 to _cnt.
    x_ = x + cos( a ) * l.
    y_ = y + sin( a ) * l.
    ic = x.  _vect+2(5)  = ic.
    ic = y.  _vect+8(5)  = ic.
    ic = x_. _vect+15(5) = ic.
    ic = y_. _vect+21(5) = ic.
    append _vect.
    if d lt _lim.
      add 1 to d.
      l_ = l * _s1. a_ = a + _a1. perform t using x_ y_ l_ a_ d.
      l_ = l * _s2. a_ = a + _a2. perform t using x_ y_ l_ a_ d.
      l_ = l * _s3. a_ = a + _a3. perform t using x_ y_ l_ a_ d.
    endif.
  endform.



zexp_fract_screenshot.gif
 Description:
This screenshot was created on a 4.5B NT R/3 System
 Filesize:  4.02 KB
 Viewed:  8582 Time(s)

zexp_fract_screenshot.gif


Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dialog Programming -> Graphics All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.