SRL Archive - Help

Math in Simba?


Element17

2012-09-12 12:15:44

Is it possible to "graph" draw/debug a parabola x^2 in Simba on the minimap and then search for something with in that parabola?

J J

2012-09-12 13:07:53

Sorry, but what would be the point? A picture would help out a lot.
You can use maths in simba and manually calculate the area.

Runaway

2012-09-12 13:36:19

You mean something like this?


program new;
{$i SRL/SRL.simba}
{$i SRL/SRL/Misc/Debug.simba}

function TPAFromParabola(Width: Integer; Power: Extended; Down: Boolean; Origin: TPoint): TPointArray;
var
Parabola, TPA: TPointArray;
P: TPoint;
n, x, i: Integer;
begin
SetLength(Result, 0);
SetLength(Parabola, (Width * 2) + 1);
case Down of
True: n := 1;
False: n := -1;
end;
i := 0;
for x := -Width to Width do
begin
P := Point(x, n * Round(Pow(x, Power)));
Parabola[i] := Point(P.x + Origin.x, P.y + Origin.y);
if (i > 0) then
begin
TPA := TPABetweenPoints(Parabola[i - 1], Parabola[i], 1, 0);
AppendTPA(Result, TPA);
end;
Inc(i);
end;
end;

var
TPA: TPointArray;
Colors: TIntegerArray;

begin
TPA := TPAFromParabola(7, 2, True, Point(MMCX, MMCY));
FillEllipse(TPA);
DebugTPA(TPA, '');
//Colors := GetColors(TPA);
end.

Element17

2012-09-12 16:18:09

From: J J
Sorry, but what would be the point? A picture would help out a lot.
You can use maths in simba and manually calculate the area.



http://s1192.photobucket.com/albums/aa321/andrewvar/?action=view¤t=180px-Minimap_-_player_and_npc_dots.png

Either one. It could be used to search an area of the minimap. I'm not sure it was just a thought. I was hmmm maybe?

@Runaway that looks like what I was thinking, not that complex but it looks awesome. Haven't tested as I'm on my phone.

Runaway

2012-09-13 11:35:40

From: Element17
http://s1192.photobucket.com/albums/aa321/andrewvar/?action=view¤t=180px-Minimap_-_player_and_npc_dots.png

Either one. It could be used to search an area of the minimap. I'm not sure it was just a thought. I was hmmm maybe?

@Runaway that looks like what I was thinking, not that complex but it looks awesome. Haven't tested as I'm on my phone.


From the looks of that picture, the function I posted above should do exactly what you want :p