Board index » delphi » Log(Log) Axes

Log(Log) Axes

I search how make a log(log) axe in a graph. I search all solution same buy
a composant for it.
   ___   ___________________________________________
 {~._.~}           Nathana?l SEMHOUN
  ( Y )  Email: semho...@epita.fr ou nsemh...@sda.cc
 ()~*~()       Tel : 06.60.24.90.20
  ( . ) Visitez: http://www.sda.cc/perso/officinema
 (_)-(_) ___________________________________________
 

Re:Log(Log) Axes


You'll have to map the log/log coordinates to the
screen coordinates.
Define the Screen coordinates as :
x: tlx to brx
y: tly to bry

Define the World coordinates as :
x: frxlow to frxhigh
y: frylow to fryhigh

Then map as follows ( the linear mappings are included):

function TXYPlots.mapW2SxLin(xf:extended):integer;
begin
 result:=round(tlx+(xf-frxlow)*(brx-tlx)/(frxhigh-frxlow));
end;
function TXYPlots.mapW2SyLin(yf:extended):integer;
begin
 result:=round(bry-(yf-frylow)*(bry-tly)/(fryhigh-frylow));
end;
function TXYPlots.mapW2SxLog(xf:extended):integer;
begin
 result:=round(tlx+(ln(xf/frxlow)/ln(frxhigh/frxlow))*(brx-tlx));
end;
function TXYPlots.mapW2SyLog(yf:extended):integer;
begin
 result:=round(bry-round((ln(yf/frylow)/ln(fryhigh/frylow))*(bry-tly)));
end;
function TXYPlots.mapS2WxLin(xs:integer):extended;
begin
 result:=frxlow+(xs-tlx)*(frxhigh-frxlow)/(brx-tlx);
end;
function TXYPlots.mapS2WyLin(ys:integer):extended;
begin
 result:=fryhigh-(ys-tly)*(fryhigh-frylow)/(bry-tly);
end;
function TXYPlots.mapS2WxLog(xs:integer):extended;
begin
 result:=frxlow*exp(((xs-tlx)/(brx-tlx))*ln(frxhigh/frxlow));
end;
function TXYPlots.mapS2WyLog(ys:integer):extended;
begin
 result:=fryhigh/exp(((ys-tly)/(bry-tly)*ln(fryhigh/frylow)));
end;

Rene

Quote
SEMHOUN Nathana?l wrote:

> I search how make a log(log) axe in a graph. I search all solution same buy
> a composant for it.

Re:Log(Log) Axes


TeeChart Pro 4 does log axes, with now automatic
log labelling.
You can download a free upgrade from our web
site for all Delphi and C++ Builder versions.
Regards !
David Berneda
www.teemach.com

SEMHOUN Nathana?l escribi en mensaje <6ut121$q...@forums.borland.com>...

Quote
>I search how make a log(log) axe in a graph. I search all solution same buy
>a composant for it.
>   ___   ___________________________________________
> {~._.~}           Nathana?l SEMHOUN
>  ( Y )  Email: semho...@epita.fr ou nsemh...@sda.cc
> ()~*~()       Tel : 06.60.24.90.20
>  ( . ) Visitez: http://www.sda.cc/perso/officinema
> (_)-(_) ___________________________________________

Other Threads