View Full Version : Math in Simba?
Element17
09-12-2012, 04:15 PM
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?
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
09-12-2012, 05:36 PM
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
09-12-2012, 08:18 PM
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
09-13-2012, 03:35 PM
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
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.