ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: isa <iscander@mercuri.mk.ua>
To: Ilya Palagin <community@altlinux.ru>
Subject: [Comm] Re: [Comm] Как сделать удобные шкалы на осях координат?
Date: Thu, 27 Feb 2003 12:13:22 +0200
Message-ID: <745482062.20030227121322@mercuri.mk.ua> (raw)
In-Reply-To: <3E5C8900.30606@fioc.kz>

Здравствуйте, Илья!
Я в свое время писал своей девушке программку на (Делфях правда) и там
выбор диапазона делался так:

procedure  SelectRange( a , b: real);
      var dummy,down,up :real;
            n: integer;
begin
      if a=b then
      begin
        n:= Round(log10(a));
        dummy:=round(a/power(10,n-1));
        while dummy>=a do dummy:=dummy-power(10,n-1)*5;
          down:=dummy;
        while dummy<=a do dummy:=dummy+power(10,n-1)*5;
          up:=dummy;
      end
     else
     begin
         dummy:=abs(a-b);
         n:= Round(log10(dummy));
         down:=min(a,b);
         up:=max(a,b);

         dummy:=round(up/power(10,n-1));
         dummy:=dummy*power(10,n-1);
         while dummy <= up do dummy:=dummy+power(10,n-1)*5;
         up:=dummy;

         dummy:=round(down/power(10,n-1));
         dummy:=dummy*power(10,n-1);
         while dummy >= down do dummy:=dummy-power(10,n-1)*5;
         down:=dummy;
     end;
          Tmin:=min(down,up);   // Tmin, Tmax в Сишных терминах
          Tmax:=max(down,up);  // глобальные переменные -
                               // соответсвующие  мин-максимуму оси
                               // абсцис


end;    // Selecting rang

 Она сдала с первого раза, если у вас будут вопросы не стесняйтесь
 спрашивайте, впринципе это чистый Паскаль, но если надо могу
 прекинуть в Си
-- 
С уважением,
 isa                          mailto:iscander@mercuri.mk.ua




  parent reply	other threads:[~2003-02-27 10:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-26  9:29 Ilya Palagin
2003-02-26 10:01 ` Mike Lykov
2003-02-26 10:05   ` Ilya Palagin
2003-02-26 10:26     ` Maxim.Savrilov
2003-02-26 11:05       ` Ilya Palagin
2003-02-26 11:06     ` [Comm] [JT] " Maxim.Savrilov
2003-02-26 10:25 ` [Comm] " Sergey Degtyaryov
2003-02-26 10:56   ` Ilya Palagin
2003-02-26 11:39     ` Sergey Degtyaryov
2003-02-27 10:13 ` isa [this message]
2003-02-27 23:57   ` [Comm] " Vitaly Lugovsky
2003-02-28  3:06     ` Ilya Palagin
2003-02-28  3:27       ` Vitaly Lugovsky
2003-03-01  9:55     ` [Comm] Re[2]: " isa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=745482062.20030227121322@mercuri.mk.ua \
    --to=iscander@mercuri.mk.ua \
    --cc=community@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git