Logo by Cyclops - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit the official fractalforums.com Youtube Channel
 
*
Welcome, Guest. Please login or register. April 19, 2024, 08:34:57 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: skew bug with help lines  (Read 588 times)
Description: clicking lots of times in the same location.. boom
0 Members and 1 Guest are viewing this topic.
claude
Fractal Bachius
*
Posts: 563



WWW
« on: April 10, 2017, 10:31:06 PM »

Seems there is a bad bug with Skew.  Selecting "help lines" and clicking lots of times without moving the mouse sometimes makes Kalles Fraktaler use all my memory, eventually crashing...

Tested with WINE, both my GMP fork and Karl's 2.11.1 (64bit) have the problem...

Meanwile the operation of skew help lines when it does work seems inefficient - I think it could be done with a bit of maths in one pass instead of iteratively... will try to figure it out tonight and report back here...

EDIT here's the formula I worked out for the skew, for two lines AB and CD:

skew% = 100% / sqrt( - ((ay-by)(cy-dy)) / ((ax-bx)(cx-dx)) )

derivation:
skew by lambda is  (x, y) -> (x +lambda x, y) = ((1 + lambda) x, y)
dot product is 0 at right angles, so: (1 + lambda)^2 (ax-bx) (cx-dx) + (ay-by)(cy-dy) = 0
solve the quadratic gives lamda = -1 +/- sqrt( - ((ay-by)(cy-dy)) / ((ax-bx) (cx-dx)) )
investigating the gui mapping, set alpha = 1 + lambda, then skew% = 100% / alpha = the formula above

Not 100% sure the formula is correct, as it seems deceptively simple...
« Last Edit: April 10, 2017, 11:26:21 PM by claude, Reason: fix error in formula » Logged
Kalles Fraktaler
Fractal Senior
******
Posts: 1458



kallesfraktaler
WWW
« Reply #1 on: April 11, 2017, 06:03:40 PM »

Claude, I am in no doubt that you are able to find a mathematical solution for this, as you did with inflection smiley
I was only able to come up with a trial and error function...
So it would be awesome if you would be able to succeed with this!
Logged

Want to create DEEP Mandelbrot fractals 100 times faster than the commercial programs, for FREE? One hour or one minute? Three months or one day? Try Kalles Fraktaler http://www.chillheimer.de/kallesfraktaler
http://www.facebook.com/kallesfraktaler
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #2 on: April 12, 2017, 03:50:39 PM »

It's not the whole story as I just noticed the help-lines function adjusts the rotation too (which makes it possible to solve in more cases I think - just adjusting skew means two lines sloping the same way can never be skewed to 90deg, as witnessed by a negative within the sqrt in the formula).

One way to solve it would be to automatically rotate so that the lines form a symmetric V shape first (which should be quite easy) before skewing.  I think the symmetry will also give the minimal skew amount needed, but I need to check this.  Might give more rotation than desired.

I guess for full generality it needs another parameter (rotation before skew, skew amount, and also rotation after skew).
Logged
Kalles Fraktaler
Fractal Senior
******
Posts: 1458



kallesfraktaler
WWW
« Reply #3 on: April 12, 2017, 07:40:12 PM »

It's not the whole story as I just noticed the help-lines function adjusts the rotation too (which makes it possible to solve in more cases I think - just adjusting skew means two lines sloping the same way can never be skewed to 90deg, as witnessed by a negative within the sqrt in the formula).

One way to solve it would be to automatically rotate so that the lines form a symmetric V shape first (which should be quite easy) before skewing.  I think the symmetry will also give the minimal skew amount needed, but I need to check this.  Might give more rotation than desired.

I guess for full generality it needs another parameter (rotation before skew, skew amount, and also rotation after skew).

Yes, the thing I call "skewing" is two parts, stretch and rotation.
There may be an easier way to skew in one go.
A big disadvantage with my method is that the rotation options are then consumed, so the program cannot rotate a cool skewed pattern in e.g. the burning ship fractal, as you can without skewing in e.g. standard Mandelbrot.
The reason is that all of rotation and stretching needs to be done before the pixels are rendered, in order to preserve quality.
One way could perhaps be to add a second rotation, after all of the current skewing.
Or, preferable, do the skewing in a better mathematical way first, and then the rotation?
Logged

Want to create DEEP Mandelbrot fractals 100 times faster than the commercial programs, for FREE? One hour or one minute? Three months or one day? Try Kalles Fraktaler http://www.chillheimer.de/kallesfraktaler
http://www.facebook.com/kallesfraktaler
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #4 on: April 13, 2017, 09:07:53 PM »

One way could perhaps be to add a second rotation, after all of the current skewing.
Or, preferable, do the skewing in a better mathematical way first, and then the rotation?

I think the skew method is fine as it is from a mathematical point of view.  Adding a second rotation after the current transform would be the way to go I think, shouldn't be hard to implement.
Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Lines 3D Art titia 0 1497 Last post April 25, 2009, 11:53:17 AM
by titia
Vase Lines Mandelbulb3D Gallery mario837 0 1122 Last post April 07, 2011, 07:01:03 PM
by mario837
Lines Images Showcase (Rate My Fractal) JC.Guarneros 0 1937 Last post June 02, 2012, 03:40:02 AM
by JC.Guarneros
Easy skew function - Kalles Fraktaler 2.7.3 Kalles Fraktaler Kalles Fraktaler 7 1271 Last post October 23, 2014, 01:25:41 PM
by youhn
Showing the skew Movies Showcase (Rate My Movie) Kalles Fraktaler 2 511 Last post April 26, 2015, 06:45:38 PM
by 3dickulus

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.139 seconds with 26 queries. (Pretty URLs adds 0.007s, 2q)