IRC channel logs

2017-10-03.log

back to list of logs

<void_pointer>back after a long time away
<void_pointer>Saw the discussion on guile-clutter
<void_pointer>looks like a really direct drawing API
<void_pointer>is it Gnome 2 based like guile-gnome, or is it Gnome 3 based?
<daviid>scheme@(guile-user)> (atan 0.97489 -0.22270)
<daviid>$11 = 1.795378814259626
<daviid>_but_
<daviid>scheme@(guile-user)> (atan (/ 0.97489 -0.22270))
<daviid>$12 = -1.3462138393301673
<void_pointer>Can confirm, got the same answers in guile master. Going to check another scheme implementation
<daviid>void_pointer: was about to do the same
<void_pointer>Got the same answer in chicken
<daviid>same in racket to, I guess I'm missing some knowledge here, I expected the result to be -1.3462138393301673 in both case
<void_pointer>One second, found relevant section in R5RS
<daviid>but according to the doc, I think my expectation is correct?
<daviid>void_pointer: tx for helping me here!
<void_pointer>"The two-argument variant of ‘atan’ computes (angle (make-rectangular x y)) (see below), even in implementations that don’t support general complex numbers."
<void_pointer>Hmm, I think I need to think on this one a bit more as to why it would be different.
<daviid>I read and read the doc again, I can not convince myself I should not expect the resut to be -1.3462138393301673 in both case
<void_pointer>compared to one argument.
<daviid>void_pointer: where did yu read the aboce?
<daviid>above
<void_pointer>Bottom of page 46 of the R5RS standard doc that can be built from what is included in the Guile source
<void_pointer>Wait
<void_pointer>I think I got it. One second
<daviid>ok
<daviid>scheme@(guile-user)> (make-rectangular -0.22270 0.97489)
<daviid>$14 = -0.2227+0.97489i
<daviid>scheme@(guile-user)> (atan $14)
<daviid>$15 = -0.7854046767562266+1.0912219371001213i
<daviid>
<void_pointer>They are the same answer
<void_pointer>Just offset by pi
<void_pointer>When you give two arguments to atan, it knows which quadrant you are in and can give a non-ambiguous angle
<mwette>depends which branch you are on -- e.g., sqrt(4) is -2 and 2 : offset by pi
<daviid>but $15 is a complex number, not (atan (/ 0.97489 -0.22270))
<daviid><daviid> $12 = -1.3462138393301673
<void_pointer>But when you divide, you lose branch information since while (atan 0.97489 -0.22270) and (atan -0.97489 0.22270) are different, they look the same when you do the division
<void_pointer>Not quite how atan of two arguments works. (atan y x) is equivalent to (angle (make-rectangular x y))
<void_pointer>As in, (define atan (lambda (x y) (angle (make-rectangular x y))))
<void_pointer>As opposed to (atan (make-rectangular x y))
<daviid>void_pointer: (a) it seems ur implementation does not call make-rectangular, since doing so I guet diff results; (b) when I try your later lambda def here:
<daviid> (define atany (lambda (x y) (angle (make-rectangular x
<daviid> y))))
<daviid>scheme@(guile-user)> (atany -0.22270 0.97489)
<daviid>$18 = 1.795378814259626
<daviid>that gives 102 degree (+-), I expect 77 degree here (+-)
<daviid>I need to undrstand better ...
<void_pointer>I might have gotten the argument order mixed up. One second
<daviid>bw right back, have to move table wher I'm sitting (in a lbrary ...)
<void_pointer>(define atany (lambda (y x) (angle (make-rectangular x y))))
<void_pointer>yes, I did
<daviid>ah
<daviid>let me move table and get back
<void_pointer>I mixed up the argument order in the lambda definition (or equivalently, in how it is passed to make-rectangular)
<void_pointer>sorry about the confusion
<daviid>ok, back :)
<daviid>that does not sounds good either
<daviid>scheme@(guile-user)> (define atany (lambda (y x) (angle (make-rectangular x y))))
<daviid>scheme@(guile-user)> (atany -0.22270 0.97489)
<daviid>$19 = -0.2245824874647294
<daviid>scheme@(guile-user)> (/ (* $19 180) %pi)
<daviid>$20 = -12.86762868427871
<void_pointer>(atany 0.97489 -0.22270) will give 1.795378814259626 as expected
<daviid>oh sorry
<void_pointer>no need to apologize
<void_pointer>argument order is easy to mix up
<daviid>scheme@(guile-user)> (atany 0.97489 -0.22270)
<void_pointer>i did it, you did it
<daviid>$21 = 1.795378814259626
<daviid>scheme@(guile-user)> (/ (* $21 180) %pi)
<daviid>$22 = 102.86762868427871
<void_pointer>it happens
<void_pointer>It should be 102 degrees. 0.97489 is your opposite and -0.22270 is your adjacent. That puts it in the second quadrant (assuming I remember the number order right) which is 90 degrees to 180 degrees. Specifically, it is close to vertical but ever so slightly offset to the left in a typical cartesian coordinates, which matches 102.87 degrees
<void_pointer>Now, if your adjacent was 0.22270, then, yes, you should get 77 degrees
<void_pointer>by symmetry about the y-axis
<void_pointer>I might have misused a term in my last message
<daviid>void_pointer: these values (for info) are the eigenvector major x and y returned by vigra (one of the feature on a specific particle): but imagej (sort of another lib I use to cross check results when indoubdt) returns 77deg for ellipses major and minor angle ... hence I started to investigate
<void_pointer>but it conveys the gist of it
<void_pointer>ah
<void_pointer>only barely used imagej, never used vigra
<void_pointer>well, it might be that they use different axes definitions
<daviid>never used make-rectangle, and reading uur doc, atan does what atan2 C function does (iiuc), and, apart fro a sign problem, if I manually do (/ y x) I get the (sign apart) result
<daviid>I will check with the Vigra folks
<void_pointer>if one does the typical cartesian (right is +x and up is +y) and one does right as +x and down as +y, then this could be the result (need to think about it a bit more)
<void_pointer>also, some systems measure angle form the x axis but others from the y axis
<daviid>void_pointer: I'm under the imprssion there is a bug i the vigra eigen vector sign
<sneek>Got it.
<daviid>sneek: what did you get?
<daviid>(our bot is boored and wants to work a bit more I guess ...)
<daviid>void_pointer: thanks for your time on this one! will talk to the Vigra folks and wil let you know
<void_pointer>ok, so if vigra does right is +x and down is +y and measures angle from the +x axis, then you get 77 - 180 degrees
<void_pointer>and for an ellipses major and minor angle, there is a 180 degree ambiguity I think if I understand the definitions you are using correctly (rotating the ellipse by 180 degrees doesn't change the orientation)
<void_pointer>so then vigra giving 77 degrees is correct assuming the coordinate system is +x is to the right and +y is down
<daviid>void_pointer: but vigra gives me 102 and that is not coorect
<void_pointer>reread what you said earlier
<void_pointer>mixed vigra and imagej up
<void_pointer>what I just said for vigra, I mean for imagej
<void_pointer>sorry about the mixup
<void_pointer>mixing things up left and right tonight
<daviid>void_pointer: ok, imagej does the right thing here, but no big desl, the big deal is I have to understand and write to them to ask ...
<daviid>void_pointer: this is the correct answer:
<daviid>scheme@(guile-user)> ,use (cv)
<daviid>scheme@(guile-user)> (atan 0.97489 0.22270)
<daviid>$2 = 1.3462138393301673
<daviid>scheme@(guile-user)> (/ (* $2 180) %pi)
<daviid>$3 = 77.1323713157213
<daviid>thanks for you help
<void_pointer>no problem
<void_pointer>also, sorry for confusing you with all of my mixups
<daviid>void_pointer: you might be interested to grab guile-cv then ...
<void_pointer>i've been following it a bit
<void_pointer>right now, I do all my image processing at work in python because we are a Pythin, C, C++, Fortran workplace
<void_pointer>but I try to keep an eye on other things for hobby stuff
<daviid>ok, if you clone and checkout the devel branch, yu can try new 22 features, and these eigen vector and values ...
<void_pointer>which I will be having at some point in the future since a project I am going to work on with my wife will involve some image processing
<daviid>I would be very very happy to have you as a user
<void_pointer>eventually. Got to get a python project of mine to the 1.0 release finally and then can really get back to scheme land again.
<void_pointer>been working on getting this project to a stable release for four years. Not that far away now. Then no more hobby python except bug fixes for a while
<daviid>ok, if you install let me know ...
<daviid>what is your project?
<void_pointer>I will try to remember
<void_pointer> https://pypi.python.org/pypi/hdf5storage
<void_pointer>It is essentially a marshalling package for python types (not just the numpy types) to and from HDF5 files with support for Matlab's v7.3 MAT file metadata so that data can be transferred between the two environments with as little loss in type information and other structure as possible
<void_pointer>And alos to be able to store python types in HDF5 files conveniently and be able to read them back without losing type information (if the option is set to write the right metadata)
<daviid>I see, well congrat, not using python though, was just curious...
<void_pointer>The one alpha branch (0.1.x) is plagued by abysmal performance due to poor API and algorithm choices (enough so that many people have raised issues not knowing why their files won't load at all), places severe limits on the types of keys in dicts, some other limitations, and not possible for others to implement plugins
<void_pointer>1.0 release fixes all of these issues
<daviid>I'm scared to have to wait 1.0 for you to start to use guile-cv, that's sounds like in a long time :):)
<void_pointer>not really
<daviid>just kiddig
<void_pointer>got most of it already done
<daviid>cool
<void_pointer>if it weren't for health problems and then problems being productive with the time I do have, I could finish it enough in a week to do a beta release and then a month later to the 1.0 release depending on any issues found
<void_pointer>reality, I will probably get the beta pushed out in November or December
<daviid>void_pointer: takt it easy, health comes first
<void_pointer>then it is back to scheme. But got to get back on the R7RS-small stuff I left off on first
<void_pointer>daviid: very true. I am a living example of what happens when one doesn't do that
<void_pointer>it is why I gave a very long time table for a relatively easy task
<void_pointer>then hope to do some other fun stuff
<void_pointer>in scheme
<void_pointer>I will remember to look at guile-cv
<daviid>cool, hope you'll get better
<void_pointer>daviid: thank you. Been steadily doing so bit by bit. Funny story, actually started scheme while I was at home recovering from a surgery since I needed something to do
<void_pointer>started with "Teach Yourself Scheme in Fixnum Days" and scheme sort of just stuck in my interest ever since
<void_pointer>and now we will see how many years I stick with it before moving onto something else (a bit of a rolling stone language wise, for better or worse)
<void_pointer>anyhow, it is time to go to sleep
<daviid>ok, night
<void_pointer>goodnight
<nilg>is there a multi-threaded version of `map`?
<nilg>there is, see https://www.gnu.org/software/guile/manual/html_node/Parallel-Forms.html
<nilg>thanks nilg, that was very helpful!
<m3tti>hey folks how do you manage your additinal libraries
<m3tti>like guile-reader or guile-ncurses
<civodul>wingo: i've sent a bunch of patches for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28590
<civodul>nothing really great though
<dsmith-work>Tuesday Greetings, Guilers
<OrangeShark>Tuesday greetings!
<OrangeShark>is anyone going to LibrePlanet 2018?
<davexunit>OrangeShark: I will most likely be going.
<davexunit>I've been to the last 3.
<davexunit>er, 4 actually.
<OrangeShark>davexunit: I am going to try going, this will be my first time.
<davexunit>OrangeShark: great :)
<davexunit>I'll have Guile or Guix on my nametag, and maybe my IRC nick, so people can recognize me.
***Sophia is now known as Guest55450
<amz3`>Guest55450: hey
***logicmoo is now known as dmiles
<manumanumanu>OrangeShark: wrong continent :(
<bavier>I'd like to get to a LibrePlanet one of these days
<amz3`> http://webresidencies-solitude-zkm.com/