Cheat Engine
The Official Site of Cheat Engine

Author Message
Twistedfate
Expert Cheater
Reputation: 1

Joined: 11 Mar 2016
Posts: 212

Posted: Fri May 05, 2017 3:01 pm    Post subject: Help to translate this system of cords[mathematic] problem

I want you to make equation to calculate (x,y) from Longitudinal and Transverse lines .

(x,y) → the red numbers
blue numbers → Longitudinal cords
light blue →Transverse cords
the center cords (x51,y51) (1648,3072)

X and y full.jpg
Description:
Filesize:  197.73 KB
Viewed:  4136 Time(s)

mgr.inz.Player
I post too much
Reputation: 153

Joined: 07 Nov 2008
Posts: 4219
Location: W kraju nad Wisla. UTC+01:00

Posted: Fri May 05, 2017 8:55 pm    Post subject:

 Code: function firstTransform(x,y)   -- reflect at y=3072   -- -(y-3072)+3072=-y+3072+3072=6144-y   y=6144-y   --scale x by 2   x=2*x   --rot 45° ccw at {2*1648 , 3072}   local a,b=(2*1648),3072   local t=1/(2^0.5)   x,y = x-a, y-b   return t*x - t*y + a, t*x + t*y + b end ScaleFirstTransform_scale=nil function ScaleFirstTransform(xx,yy)   if ScaleFirstTransform_scale==nil then     -- point1 (1040,3072) -> (32,32)     local x1,y1=firstTransform(1040,3072)     -- point3 (2256,3072) -> (70,70)     local x3,y3=firstTransform(2256,3072)     --scale for x:     local ax = 38/(x3-x1)  -- 70-32 = 38     local bx = 32-x1*ax     --scale for y:     local ay = 38/(y3-y1)  -- 70-32 = 38     local by = 32-y1*ay     ScaleFirstTransform_scale = {{ax,bx},{ay,by}}   end   local t=ScaleFirstTransform_scale   local x,y = firstTransform(xx,yy)   return x*t[1][1]+t[1][2],y*t[2][1]+t[2][2] end function TwistedfateTransform(x,y)   return ScaleFirstTransform(x,y) end print('tests:') print('(1040,3072) -> (32,32), we get:',TwistedfateTransform(1040,3072)) print('(1648,1856) -> (32,70), we get:',TwistedfateTransform(1648,1856)) print('(2256,3072) -> (70,70), we get:',TwistedfateTransform(2256,3072)) print('(1648,4288) -> (70,32), we get:',TwistedfateTransform(1648,4288)) print('(1344,2464) -> (32,51), we get:',TwistedfateTransform(1344,2464)) print('(1344,3680) -> (51,32), we get:',TwistedfateTransform(1344,3680)) print('(1952,2464) -> (51,70), we get:',TwistedfateTransform(1952,2464)) print('(1952,3680) -> (70,51), we get:',TwistedfateTransform(1952,3680)) print('(1648,3072) -> (51,51), we get:',TwistedfateTransform(1648,3072))

_________________
Twistedfate
Expert Cheater
Reputation: 1

Joined: 11 Mar 2016
Posts: 212

 Posted: Sat May 06, 2017 2:15 am    Post subject: Thank you ! Thank you ! Thank you ! Thank you ! Thank you ! its read perfect !! is there any reference you used to solve that ? I didn't expect any one to solve it <3 .
mgr.inz.Player
I post too much
Reputation: 153

Joined: 07 Nov 2008
Posts: 4219
Location: W kraju nad Wisla. UTC+01:00

 Posted: Sat May 06, 2017 5:29 pm    Post subject: Some time ago I made similar 2D transformations. _________________
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT - 6 Hours Page 1 of 1

 Jump to: Select a forum Cheat Engine----------------Cheat EngineCheat Engine Lua ScriptingCheat Engine TutorialsGeneral GamehackingAuto Assembler tutorialsPointer tutorialsGame specific tutorialsWebbrowser stuff related tutorialsConsole ModdingLUA TutorialsLua Extensions General Discussions----------------General DiscussionsArtComputer TalkRandom spamArt RequestsArt TutorialsWillekeurige RotzooiGuestsHorse Excrement Cheat Requests----------------Single player cheat request Cheat Engine Downloads----------------TablesTrainersAuto Assemble scripts Coding----------------Cheat Engine SourceCETC Server and ClientsDBVMPlugin developmentGeneral programmingBinariesCrackmesGeneral programming+Game Development2D Graphics3D ModelingGameplay designWeb Development Games----------------Flash GamesGaia OnlineStick Arena
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum