Изменения в PABCSystem, GraphABC.Draw и новый пример FuncTransform
This commit is contained in:
parent
44956a9a2a
commit
12d6b1290b
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
|||
public const string Major = "3";
|
||||
public const string Minor = "0";
|
||||
public const string Build = "0";
|
||||
public const string Revision = "1131";
|
||||
public const string Revision = "1132";
|
||||
|
||||
public const string MainVersion = Major + "." + Minor;
|
||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%COREVERSION%=0
|
||||
%REVISION%=1131
|
||||
%MINOR%=0
|
||||
%REVISION%=1132
|
||||
%COREVERSION%=0
|
||||
%MAJOR%=3
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
uses
|
||||
GraphABC;
|
||||
|
||||
var
|
||||
h := 0.01;
|
||||
mx := 2.0;
|
||||
my := 0.35;
|
||||
dy := 0.0;
|
||||
dx := 0.0;
|
||||
f: real -> real := x -> x * sin(x);
|
||||
|
||||
function Transform(f: real -> real): real -> real;
|
||||
begin
|
||||
Result := x -> my * f(mx * (x + dx)) + dy;
|
||||
end;
|
||||
|
||||
procedure DrawGraphic(f: real -> real);
|
||||
begin
|
||||
Draw(f, -5, 5, -3, 3);
|
||||
Window.Title := Format('mx={0:f2} my={1:f2} dx={2:f2} dy={3:f2}', mx, my, dx, dy);
|
||||
Redraw;
|
||||
end;
|
||||
|
||||
procedure KeyDown(key: integer);
|
||||
const
|
||||
ArrowKeys: set of integer = [vk_Left, vk_Right, vk_Up, vk_Down, vk_Home, vk_End, vk_PageUp, vk_PageDown];
|
||||
begin
|
||||
var g := Transform(f);
|
||||
case key of
|
||||
vk_Left: my -= h;
|
||||
vk_Right: my += h;
|
||||
vk_Up: mx -= h;
|
||||
vk_Down: mx += h;
|
||||
vk_Home: dx += h;
|
||||
vk_PageUp: dx -= h;
|
||||
vk_PageDown: dy += h;
|
||||
vk_End: dy -= h;
|
||||
end;
|
||||
if key in ArrowKeys then
|
||||
DrawGraphic(g);
|
||||
end;
|
||||
|
||||
begin
|
||||
DrawGraphic(Transform(f));
|
||||
LockDrawing;
|
||||
OnKeyDown := KeyDown;
|
||||
end.
|
||||
|
|
@ -1 +1 @@
|
|||
!define VERSION '3.0.0.1131'
|
||||
!define VERSION '3.0.0.1132'
|
||||
|
|
|
|||
|
|
@ -580,16 +580,18 @@ function ClientRectangle: System.Drawing.Rectangle;
|
|||
//------------------------------------------
|
||||
//// Рисование графиков функций
|
||||
//------------------------------------------
|
||||
/// Рисует график функции f на отрезке [a,b] в прямоугольнике, задаваемом координатами x1,y1,x2,y2,
|
||||
procedure Draw(f: Func<real,real>; a,b: real; x1,y1,x2,y2: integer);
|
||||
/// Рисует график функции f на отрезке [a,b] в прямоугольнике r
|
||||
procedure Draw(f: Func<real,real>; a,b: real; r: System.Drawing.Rectangle);
|
||||
/// Рисует график функции f на отрезке [-5,5] в прямоугольнике r
|
||||
procedure Draw(f: Func<real,real>; r: System.Drawing.Rectangle);
|
||||
/// Рисует график функции f на отрезке [a,b] на полное графическое окно
|
||||
procedure Draw(f: Func<real,real>; a,b: real);
|
||||
/// Рисует график функции f на отрезке [-5,5] на полное графическое окно
|
||||
procedure Draw(f: Func<real,real>);
|
||||
/// Рисует график функции f, заданной на отрезке [a,b] по оси абсцисс и на отрезке [min,max] по оси ординат, в прямоугольнике, задаваемом координатами x1,y1,x2,y2,
|
||||
procedure Draw(f: real -> real; a,b,min,max: real; x1,y1,x2,y2: integer);
|
||||
/// Рисует график функции f, заданной на отрезке [a,b], в прямоугольнике, задаваемом координатами x1,y1,x2,y2,
|
||||
procedure Draw(f: real -> real; a,b: real; x1,y1,x2,y2: integer);
|
||||
/// Рисует график функции f, заданной на отрезке [a,b], в прямоугольнике r
|
||||
procedure Draw(f: real -> real; a,b: real; r: System.Drawing.Rectangle);
|
||||
/// Рисует график функции f, заданной на отрезке [-5,5], в прямоугольнике r
|
||||
procedure Draw(f: real -> real; r: System.Drawing.Rectangle);
|
||||
/// Рисует график функции f, заданной на отрезке [a,b], на полное графическое окно
|
||||
procedure Draw(f: real -> real; a,b: real);
|
||||
/// Рисует график функции f, заданной на отрезке [-5,5], на полное графическое окно
|
||||
procedure Draw(f: real -> real);
|
||||
|
||||
//------------------------------------------
|
||||
//// Рисование изображений
|
||||
|
|
@ -3490,7 +3492,7 @@ end;
|
|||
type FS = auto class
|
||||
mx,my,a,max: real;
|
||||
x0,y0: integer;
|
||||
f: Func<real,real>;
|
||||
f: real -> real;
|
||||
|
||||
function Apply(x: real): Point;
|
||||
begin
|
||||
|
|
@ -3498,7 +3500,15 @@ type FS = auto class
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure Draw(f: Func<real,real>; a,b: real; x1,y1,x2,y2: integer);
|
||||
procedure Draw(f: real -> real; a,b,min,max: real; x1,y1,x2,y2: integer);
|
||||
begin
|
||||
Rectangle(x1,y1,x2+1,y2+1);
|
||||
var n := (x2-x1) div 3;
|
||||
var fso := new FS((x2-x1)/(b-a),(y2-y1)/(max-min),a,max,x1,y1,f);
|
||||
Polyline(Range(a,b,n).Select(fso.Apply).ToArray)
|
||||
end;
|
||||
|
||||
procedure Draw(f: real -> real; a,b: real; x1,y1,x2,y2: integer);
|
||||
begin
|
||||
Rectangle(x1,y1,x2+1,y2+1);
|
||||
var n := (x2-x1) div 3;
|
||||
|
|
@ -3508,7 +3518,7 @@ begin
|
|||
Polyline(Range(a,b,n).Select(fso.Apply).ToArray)
|
||||
end;
|
||||
|
||||
procedure Draw(f: Func<real,real>; a,b: real; r: System.Drawing.Rectangle);
|
||||
procedure Draw(f: real -> real; a,b: real; r: System.Drawing.Rectangle);
|
||||
var x1 := r.X; y1 := r.Y;
|
||||
x2 := r.X+r.Width-1;
|
||||
y2 := r.Y+r.Height-1;
|
||||
|
|
@ -3516,12 +3526,12 @@ begin
|
|||
Draw(f,a,b,x1,y1,x2,y2);
|
||||
end;
|
||||
|
||||
procedure Draw(f: Func<real,real>; r: System.Drawing.Rectangle);
|
||||
procedure Draw(f: real -> real; r: System.Drawing.Rectangle);
|
||||
begin
|
||||
Draw(f,-5,5,r);
|
||||
end;
|
||||
|
||||
procedure Draw(f: Func<real,real>; a,b: real);
|
||||
procedure Draw(f: real -> real; a,b: real);
|
||||
var x1 := 0; y1 := 0;
|
||||
x2 := Window.Width-1;
|
||||
y2 := Window.Height-1;
|
||||
|
|
@ -3529,7 +3539,7 @@ begin
|
|||
Draw(f,a,b,x1,y1,x2,y2);
|
||||
end;
|
||||
|
||||
procedure Draw(f: Func<real,real>);
|
||||
procedure Draw(f: real -> real);
|
||||
begin
|
||||
Draw(f,-5,5);
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -1155,8 +1155,12 @@ function Power(x, y: integer): real;
|
|||
function Power(x: BigInteger; y: integer): BigInteger;
|
||||
/// Возвращает x, округленное до ближайшего целого
|
||||
function Round(x: real): integer;
|
||||
/// Возвращает целую часть числа x
|
||||
/// Возвращает x, округленное до ближайшего большого целого
|
||||
function RoundBigInteger(x: real): BigInteger;
|
||||
/// Возвращает целую часть вещественного числа x
|
||||
function Trunc(x: real): integer;
|
||||
/// Возвращает целую часть вещественного числа x как BigInteger
|
||||
function TruncBigInteger(x: real): BigInteger;
|
||||
/// Возвращает целую часть числа x
|
||||
function Int(x: real): real;
|
||||
/// Возвращает дробную часть числа x
|
||||
|
|
@ -2977,6 +2981,66 @@ end;
|
|||
//------------------------------------------------------------------------------
|
||||
// Extension methods for BigInteger
|
||||
//------------------------------------------------------------------------------
|
||||
function BigInteger.operator>(p: BigInteger; q: integer): boolean;
|
||||
begin
|
||||
Result := p > BigInteger.Create(q);
|
||||
end;
|
||||
|
||||
function BigInteger.operator>(p: integer; q: BigInteger): boolean;
|
||||
begin
|
||||
Result := BigInteger.Create(p) > q;
|
||||
end;
|
||||
|
||||
function BigInteger.operator<(p: BigInteger; q: integer): boolean;
|
||||
begin
|
||||
Result := p < BigInteger.Create(q);
|
||||
end;
|
||||
|
||||
function BigInteger.operator<(p: integer; q: BigInteger): boolean;
|
||||
begin
|
||||
Result := BigInteger.Create(p) < q;
|
||||
end;
|
||||
|
||||
function BigInteger.operator>=(p: BigInteger; q: integer): boolean;
|
||||
begin
|
||||
Result := p >= BigInteger.Create(q);
|
||||
end;
|
||||
|
||||
function BigInteger.operator>=(p: integer; q: BigInteger): boolean;
|
||||
begin
|
||||
Result := BigInteger.Create(p) >= q;
|
||||
end;
|
||||
|
||||
function BigInteger.operator<=(p: BigInteger; q: integer): boolean;
|
||||
begin
|
||||
Result := p <= BigInteger.Create(q);
|
||||
end;
|
||||
|
||||
function BigInteger.operator<=(p: integer; q: BigInteger): boolean;
|
||||
begin
|
||||
Result := BigInteger.Create(p) <= q;
|
||||
end;
|
||||
|
||||
function BigInteger.operator=(p: BigInteger; q: integer): boolean;
|
||||
begin
|
||||
Result := p = BigInteger.Create(q);
|
||||
end;
|
||||
|
||||
function BigInteger.operator=(p: integer; q: BigInteger): boolean;
|
||||
begin
|
||||
Result := BigInteger.Create(p) = q;
|
||||
end;
|
||||
|
||||
function BigInteger.operator<>(p: BigInteger; q: integer): boolean;
|
||||
begin
|
||||
Result := p <> BigInteger.Create(q);
|
||||
end;
|
||||
|
||||
function BigInteger.operator<>(p: integer; q: BigInteger): boolean;
|
||||
begin
|
||||
Result := BigInteger.Create(p) <> q;
|
||||
end;
|
||||
|
||||
procedure BigInteger.operator+=(var p: BigInteger; q: BigInteger);
|
||||
begin
|
||||
p := p + q;
|
||||
|
|
@ -6095,11 +6159,21 @@ begin
|
|||
Result := Convert.ToInt32(Math.Round(x));
|
||||
end;
|
||||
|
||||
function RoundBigInteger(x: real): BigInteger;
|
||||
begin
|
||||
Result := BigInteger.Create(Math.Round(x));
|
||||
end;
|
||||
|
||||
function Trunc(x: real): integer;
|
||||
begin
|
||||
Result := Convert.ToInt32(Math.Truncate(x));
|
||||
end;
|
||||
|
||||
function TruncBigInteger(x: real): BigInteger;
|
||||
begin
|
||||
Result := BigInteger.Create(Math.Truncate(x));
|
||||
end;
|
||||
|
||||
function Int(x: real): real;
|
||||
begin
|
||||
//if x>=0 then
|
||||
|
|
@ -7169,7 +7243,7 @@ begin
|
|||
end;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// char ext
|
||||
// char методы расширения
|
||||
//------------------------------------------------------------------------------
|
||||
// Преобразовать символ в цифру
|
||||
function char.ToDigit(self: char): integer; extensionmethod;
|
||||
|
|
@ -7230,7 +7304,7 @@ begin
|
|||
end;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// string ext
|
||||
// string методы расширения
|
||||
//------------------------------------------------------------------------------
|
||||
/// Преобразует строку в целое
|
||||
function string.ToInteger: integer;
|
||||
|
|
@ -7238,6 +7312,12 @@ begin
|
|||
Result := integer.Parse(Self);
|
||||
end;
|
||||
|
||||
/// Преобразует строку в BigInteger
|
||||
function string.ToBigInteger: BigInteger;
|
||||
begin
|
||||
Result := BigInteger.Parse(Self);
|
||||
end;
|
||||
|
||||
/// Преобразует строку в вещественное
|
||||
function string.ToReal: real;
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -1,18 +1,16 @@
|
|||
<?xml version="1.0"?>
|
||||
<AspectFile xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<TreeRoot>
|
||||
<?xml version="1.0" encoding="utf-16"?>
|
||||
<AspectFile Version="2">
|
||||
<PointOfInterest>
|
||||
<Items>
|
||||
<PointOfInterest>
|
||||
<Name>Рисование графиков Draw</Name>
|
||||
<Items>
|
||||
<PointOfInterest>
|
||||
<Name>Интерфейс процедур Draw</Name>
|
||||
<FileName>\GraphABC.pas</FileName>
|
||||
<Text>procedure Draw(f: Func<real,real>; a,b: real; x1,y1,x2,y2: integer);</Text>
|
||||
<Name>Интерфейс процедур Draw</Name>
|
||||
<Items />
|
||||
<Note />
|
||||
<Context>
|
||||
<ArrayOfString>
|
||||
<OuterContext>
|
||||
<OuterContextItem Type="MethodHeader">
|
||||
<string>procedure</string>
|
||||
<string>Draw</string>
|
||||
<string>(</string>
|
||||
|
|
@ -41,19 +39,17 @@
|
|||
<string>:</string>
|
||||
<string>integer</string>
|
||||
<string>)</string>
|
||||
</ArrayOfString>
|
||||
<ArrayOfString />
|
||||
</Context>
|
||||
<ParserClassName>MethodHeader</ParserClassName>
|
||||
</OuterContextItem>
|
||||
<OuterContextItem Type="" />
|
||||
</OuterContext>
|
||||
<Items />
|
||||
</PointOfInterest>
|
||||
<PointOfInterest>
|
||||
<Name>Реализация процедур Draw</Name>
|
||||
<FileName>\GraphABC.pas</FileName>
|
||||
<Text>procedure Draw(f: Func<real,real>; a,b: real; x1,y1,x2,y2: integer);</Text>
|
||||
<Name>Реализация процедур Draw</Name>
|
||||
<Items />
|
||||
<Note />
|
||||
<Context>
|
||||
<ArrayOfString>
|
||||
<OuterContext>
|
||||
<OuterContextItem Type="Method">
|
||||
<string>procedure</string>
|
||||
<string>Draw</string>
|
||||
<string>(</string>
|
||||
|
|
@ -82,46 +78,44 @@
|
|||
<string>:</string>
|
||||
<string>integer</string>
|
||||
<string>)</string>
|
||||
</ArrayOfString>
|
||||
<ArrayOfString />
|
||||
</Context>
|
||||
<ParserClassName>Method</ParserClassName>
|
||||
</OuterContextItem>
|
||||
<OuterContextItem Type="" />
|
||||
</OuterContext>
|
||||
<Items />
|
||||
</PointOfInterest>
|
||||
</Items>
|
||||
<Context />
|
||||
</PointOfInterest>
|
||||
<PointOfInterest>
|
||||
<Name>implementation модуля</Name>
|
||||
<FileName>\GraphABC.pas</FileName>
|
||||
<Text>implementation</Text>
|
||||
<Name>implementation модуля</Name>
|
||||
<OuterContext>
|
||||
<OuterContextItem Type="PAS_TreeNode" />
|
||||
</OuterContext>
|
||||
<Items>
|
||||
<PointOfInterest>
|
||||
<Name>IOGraphABCSystem</Name>
|
||||
<FileName>\GraphABC.pas</FileName>
|
||||
<Text>IOGraphABCSystem = class(IOStandardSystem)</Text>
|
||||
<Name>IOGraphABCSystem</Name>
|
||||
<Items />
|
||||
<Note />
|
||||
<Context>
|
||||
<ArrayOfString>
|
||||
<OuterContext>
|
||||
<OuterContextItem Type="Class">
|
||||
<string>IOGraphABCSystem</string>
|
||||
<string>=</string>
|
||||
<string>class</string>
|
||||
<string>(</string>
|
||||
<string>IOStandardSystem</string>
|
||||
<string>)</string>
|
||||
</ArrayOfString>
|
||||
<ArrayOfString />
|
||||
</Context>
|
||||
<ParserClassName>Class</ParserClassName>
|
||||
</OuterContextItem>
|
||||
<OuterContextItem Type="" />
|
||||
</OuterContext>
|
||||
<Items />
|
||||
</PointOfInterest>
|
||||
<PointOfInterest>
|
||||
<Name>procedure LoadWindow с исправлениями Абрамяна</Name>
|
||||
<FileName>\GraphABC.pas</FileName>
|
||||
<Text>procedure LoadWindow(fname: string);</Text>
|
||||
<Name>procedure LoadWindow с исправлениями Абрамяна</Name>
|
||||
<Items />
|
||||
<Note />
|
||||
<Context>
|
||||
<ArrayOfString>
|
||||
<OuterContext>
|
||||
<OuterContextItem Type="Method">
|
||||
<string>procedure</string>
|
||||
<string>LoadWindow</string>
|
||||
<string>(</string>
|
||||
|
|
@ -129,69 +123,33 @@
|
|||
<string>:</string>
|
||||
<string>string</string>
|
||||
<string>)</string>
|
||||
</ArrayOfString>
|
||||
<ArrayOfString />
|
||||
</Context>
|
||||
<ParserClassName>Method</ParserClassName>
|
||||
</OuterContextItem>
|
||||
<OuterContextItem Type="" />
|
||||
</OuterContext>
|
||||
<Items />
|
||||
</PointOfInterest>
|
||||
<PointOfInterest>
|
||||
<Name>Раздел переменных</Name>
|
||||
<FileName>\GraphABC.pas</FileName>
|
||||
<Text>MainThread: Thread;</Text>
|
||||
<Name>Раздел переменных</Name>
|
||||
<Items />
|
||||
<Note />
|
||||
<Context>
|
||||
<ArrayOfString>
|
||||
<OuterContext>
|
||||
<OuterContextItem Type="Field">
|
||||
<string>MainThread</string>
|
||||
<string>:</string>
|
||||
<string>Thread</string>
|
||||
</ArrayOfString>
|
||||
<ArrayOfString />
|
||||
</Context>
|
||||
<ParserClassName>Field</ParserClassName>
|
||||
</OuterContextItem>
|
||||
<OuterContextItem Type="" />
|
||||
</OuterContext>
|
||||
<Items />
|
||||
</PointOfInterest>
|
||||
</Items>
|
||||
<Note />
|
||||
<Context>
|
||||
<ArrayOfString />
|
||||
</Context>
|
||||
<ParserClassName>PAS_TreeNode</ParserClassName>
|
||||
</PointOfInterest>
|
||||
<PointOfInterest>
|
||||
<Name>Draw для рисунка</Name>
|
||||
<FileName>\GraphABC.pas</FileName>
|
||||
<Text>procedure Draw(fname: string; x,y: integer);</Text>
|
||||
<Name>Draw для рисунка</Name>
|
||||
<Items>
|
||||
<PointOfInterest>
|
||||
<FileName>\GraphABC.pas</FileName>
|
||||
<Text>procedure Draw(fname: string; x,y: integer);</Text>
|
||||
<Name>Draw для рисунка - реаплизация</Name>
|
||||
<Items />
|
||||
<Note />
|
||||
<Context>
|
||||
<ArrayOfString>
|
||||
<string>procedure</string>
|
||||
<string>Draw</string>
|
||||
<string>(</string>
|
||||
<string>fname</string>
|
||||
<string>:</string>
|
||||
<string>string</string>
|
||||
<string>;</string>
|
||||
<string>x</string>
|
||||
<string>,</string>
|
||||
<string>y</string>
|
||||
<string>:</string>
|
||||
<string>integer</string>
|
||||
<string>)</string>
|
||||
</ArrayOfString>
|
||||
<ArrayOfString />
|
||||
</Context>
|
||||
<ParserClassName>Method</ParserClassName>
|
||||
</PointOfInterest>
|
||||
</Items>
|
||||
<Note />
|
||||
<Context>
|
||||
<ArrayOfString>
|
||||
<OuterContext>
|
||||
<OuterContextItem Type="Method">
|
||||
<string>procedure</string>
|
||||
<string>Draw</string>
|
||||
<string>(</string>
|
||||
|
|
@ -205,19 +163,42 @@
|
|||
<string>:</string>
|
||||
<string>integer</string>
|
||||
<string>)</string>
|
||||
</ArrayOfString>
|
||||
<ArrayOfString />
|
||||
</Context>
|
||||
<ParserClassName>Method</ParserClassName>
|
||||
</OuterContextItem>
|
||||
<OuterContextItem Type="" />
|
||||
</OuterContext>
|
||||
<Items>
|
||||
<PointOfInterest>
|
||||
<Name>Draw для рисунка - реаплизация</Name>
|
||||
<FileName>\GraphABC.pas</FileName>
|
||||
<Text>procedure Draw(fname: string; x,y: integer);</Text>
|
||||
<OuterContext>
|
||||
<OuterContextItem Type="Method">
|
||||
<string>procedure</string>
|
||||
<string>Draw</string>
|
||||
<string>(</string>
|
||||
<string>fname</string>
|
||||
<string>:</string>
|
||||
<string>string</string>
|
||||
<string>;</string>
|
||||
<string>x</string>
|
||||
<string>,</string>
|
||||
<string>y</string>
|
||||
<string>:</string>
|
||||
<string>integer</string>
|
||||
<string>)</string>
|
||||
</OuterContextItem>
|
||||
<OuterContextItem Type="" />
|
||||
</OuterContext>
|
||||
<Items />
|
||||
</PointOfInterest>
|
||||
</Items>
|
||||
</PointOfInterest>
|
||||
<PointOfInterest>
|
||||
<Name>Реализация графических примитивов</Name>
|
||||
<FileName>\GraphABC.pas</FileName>
|
||||
<Text>procedure SetPixel(x,y: integer; c: Color);</Text>
|
||||
<Name>Реализация графических примитивов</Name>
|
||||
<Items />
|
||||
<Note />
|
||||
<Context>
|
||||
<ArrayOfString>
|
||||
<OuterContext>
|
||||
<OuterContextItem Type="Method">
|
||||
<string>procedure</string>
|
||||
<string>SetPixel</string>
|
||||
<string>(</string>
|
||||
|
|
@ -231,19 +212,17 @@
|
|||
<string>:</string>
|
||||
<string>Color</string>
|
||||
<string>)</string>
|
||||
</ArrayOfString>
|
||||
<ArrayOfString />
|
||||
</Context>
|
||||
<ParserClassName>Method</ParserClassName>
|
||||
</OuterContextItem>
|
||||
<OuterContextItem Type="" />
|
||||
</OuterContext>
|
||||
<Items />
|
||||
</PointOfInterest>
|
||||
<PointOfInterest>
|
||||
<Name>MoveTo - extension method for Rectangle</Name>
|
||||
<FileName>\GraphABC.pas</FileName>
|
||||
<Text>procedure System.Drawing.Rectangle.MoveTo(x,y: integer);</Text>
|
||||
<Name>MoveTo - extension method for Rectangle</Name>
|
||||
<Items />
|
||||
<Note />
|
||||
<Context>
|
||||
<ArrayOfString>
|
||||
<OuterContext>
|
||||
<OuterContextItem Type="Method">
|
||||
<string>procedure</string>
|
||||
<string>System</string>
|
||||
<string>.</string>
|
||||
|
|
@ -259,12 +238,66 @@
|
|||
<string>:</string>
|
||||
<string>integer</string>
|
||||
<string>)</string>
|
||||
</ArrayOfString>
|
||||
<ArrayOfString />
|
||||
</Context>
|
||||
<ParserClassName>Method</ParserClassName>
|
||||
</OuterContextItem>
|
||||
<OuterContextItem Type="" />
|
||||
</OuterContext>
|
||||
<Items />
|
||||
</PointOfInterest>
|
||||
<PointOfInterest>
|
||||
<Name>IOGraphABCSystem</Name>
|
||||
<FileName>\GraphABC.pas</FileName>
|
||||
<Text>IOGraphABCSystem = class(IOStandardSystem)</Text>
|
||||
<OuterContext>
|
||||
<OuterContextItem Type="Class">
|
||||
<string>IOGraphABCSystem</string>
|
||||
<string>=</string>
|
||||
<string>class</string>
|
||||
<string>(</string>
|
||||
<string>IOStandardSystem</string>
|
||||
<string>)</string>
|
||||
</OuterContextItem>
|
||||
<OuterContextItem Type="Defs">
|
||||
<string>type</string>
|
||||
</OuterContextItem>
|
||||
<OuterContextItem Type="PAS_TreeNode" />
|
||||
</OuterContext>
|
||||
<InnerContext>
|
||||
<InnerContextItem Type="ClassMethod">
|
||||
<string>constructor</string>
|
||||
<string>Create</string>
|
||||
</InnerContextItem>
|
||||
<InnerContextItem Type="ClassMethod">
|
||||
<string>procedure</string>
|
||||
<string>write</string>
|
||||
<string>(</string>
|
||||
<string>obj</string>
|
||||
<string>:</string>
|
||||
<string>object</string>
|
||||
<string>)</string>
|
||||
<string>override</string>
|
||||
</InnerContextItem>
|
||||
<InnerContextItem Type="ClassMethod">
|
||||
<string>procedure</string>
|
||||
<string>writeln</string>
|
||||
<string>override</string>
|
||||
</InnerContextItem>
|
||||
<InnerContextItem Type="ClassMethod">
|
||||
<string>function</string>
|
||||
<string>read_symbol</string>
|
||||
<string>:</string>
|
||||
<string>char</string>
|
||||
<string>override</string>
|
||||
</InnerContextItem>
|
||||
<InnerContextItem Type="ClassMethod">
|
||||
<string>function</string>
|
||||
<string>peek</string>
|
||||
<string>:</string>
|
||||
<string>integer</string>
|
||||
<string>override</string>
|
||||
</InnerContextItem>
|
||||
</InnerContext>
|
||||
<Items />
|
||||
</PointOfInterest>
|
||||
</Items>
|
||||
<Context />
|
||||
</TreeRoot>
|
||||
</PointOfInterest>
|
||||
</AspectFile>
|
||||
|
|
@ -582,6 +582,10 @@ function ClientRectangle: System.Drawing.Rectangle;
|
|||
//------------------------------------------
|
||||
/// Рисует график функции f, заданной на отрезке [a,b] по оси абсцисс и на отрезке [min,max] по оси ординат, в прямоугольнике, задаваемом координатами x1,y1,x2,y2,
|
||||
procedure Draw(f: real -> real; a,b,min,max: real; x1,y1,x2,y2: integer);
|
||||
/// Рисует график функции f, заданной на отрезке [a,b] по оси абсцисс и на отрезке [min,max] по оси ординат, в прямоугольнике r
|
||||
procedure Draw(f: real -> real; a,b,min,max: real; r: System.Drawing.Rectangle);
|
||||
/// Рисует график функции f, заданной на отрезке [a,b] по оси абсцисс и на отрезке [min,max] по оси ординат, на полное графическое окно
|
||||
procedure Draw(f: real -> real; a,b,min,max: real);
|
||||
/// Рисует график функции f, заданной на отрезке [a,b], в прямоугольнике, задаваемом координатами x1,y1,x2,y2,
|
||||
procedure Draw(f: real -> real; a,b: real; x1,y1,x2,y2: integer);
|
||||
/// Рисует график функции f, заданной на отрезке [a,b], в прямоугольнике r
|
||||
|
|
@ -3505,17 +3509,26 @@ begin
|
|||
Rectangle(x1,y1,x2+1,y2+1);
|
||||
var n := (x2-x1) div 3;
|
||||
var fso := new FS((x2-x1)/(b-a),(y2-y1)/(max-min),a,max,x1,y1,f);
|
||||
Polyline(Range(a,b,n).Select(fso.Apply).ToArray)
|
||||
Polyline(Range(a,b,n).Select(fso.Apply).ToArray);
|
||||
end;
|
||||
|
||||
procedure Draw(f: real -> real; a,b,min,max: real; r: System.Drawing.Rectangle);
|
||||
var x1 := r.X; y1 := r.Y;
|
||||
x2 := r.X+r.Width-1;
|
||||
y2 := r.Y+r.Height-1;
|
||||
begin
|
||||
Draw(f,a,b,min,max,x1,y1,x2,y2);
|
||||
end;
|
||||
|
||||
procedure Draw(f: real -> real; a,b,min,max: real);
|
||||
begin
|
||||
Draw(f,a,b,min,max,ClientRectangle);
|
||||
end;
|
||||
|
||||
procedure Draw(f: real -> real; a,b: real; x1,y1,x2,y2: integer);
|
||||
begin
|
||||
Rectangle(x1,y1,x2+1,y2+1);
|
||||
var n := (x2-x1) div 3;
|
||||
var min := Range(a,b,n).Min(f);
|
||||
var max := Range(a,b,n).Max(f);
|
||||
var fso := new FS((x2-x1)/(b-a),(y2-y1)/(max-min),a,max,x1,y1,f);
|
||||
Polyline(Range(a,b,n).Select(fso.Apply).ToArray)
|
||||
Draw(f,a,b,Range(a,b,n).Min(f),Range(a,b,n).Max(f),x1,y1,x2,y2)
|
||||
end;
|
||||
|
||||
procedure Draw(f: real -> real; a,b: real; r: System.Drawing.Rectangle);
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in a new issue