May 04 2023 07:57 PM
Hello everyone,
Ever since visiting the site of Andy Pope, I saw a chart that fascinated me because it can be very useful for creating the bounding area of a set of points. It's known as Convex Hull. Here's Andy's post > https://andypope.info/charts/convexhull.htm
In the post you can download the file, and the VBA is fascinating to say the least.
I was wondering, with the LAMBDA technology and its possibility for recursiveness, is it possible with Lambda or has anyone come across a Lambda formula about it?
Thanks in advance.
May 08 2023 02:55 AM
May 08 2023 03:00 AM
May 08 2023 04:16 AM
May 08 2023 04:18 AM
No, expressions aren't allowed in literal arrays {...}, only constant values.
May 08 2023 04:39 AM
May 08 2023 07:38 AM
Afraid to generate correct answer with AI tool you need more knowledge formulating proper questions rather than to generate the formula by your own from scratch.
May 08 2023 07:41 AM
May 08 2023 08:39 AM
Can't comment details, I don't use AI. Tried with the Bing for a while, but traditional search (which after all is also AI) gives more relevant results. Perhaps in few years the tool will be more reliable, who knows. At the moment that's just a toy. But Excel MVPs as you are have to go with it, hope you give adequate feedback to Microsoft.
May 08 2023 09:23 PM
@Jan Karel Pieterse Thanks of your comments, I have tried like dozen of Lambdas out from ChatGtP but none worked. I still need to work on grasping recursiveness. Sometimes I feel like "I get it" and then in another case I lost it. :unamused_face: But I'm making progress. Learning -- thunking -- has been fun.
May 08 2023 09:31 PM
To all,
Here's another person: Fernando Cinquegrani, who developed a Convex hull UDF. Very interesting stuff. It would be nice to check out his VBA back-end but its locked.
Fernando's site: http://www.prodomosua.it/ppage02.html
On the link above, you will be able to find the workbook with the convex hull right above the section where the graph below appears.
Jun 01 2023 07:06 AM
I got some progress to connect the outer point.
=LET(xy,B3:C99,z,FILTER(xy,TAKE(xy,,1)<>""),r,SEQUENCE(ROWS(z)),st,XMATCH(0,DROP(z,,1),1),
RAD,LAMBDA(p,q,ATAN2(INDEX(q,1)-INDEX(p,1),INDEX(q,2)-INDEX(p,2))),
pl,REDUCE(HSTACK(st,0),r,LAMBDA(a,i,IF((ROWS(a)>1)*(INDEX(a,ROWS(a),1)=st),a,
LET(b,CHOOSEROWS(z,TAKE(a,-1,1)),
Nx,FILTER(r,ISNA(XMATCH(r,DROP(VSTACK(TAKE(a,,1),0),1)))),
Nr,XLOOKUP(0,MAP(Nx,LAMBDA(n,MOD(RAD(b,CHOOSEROWS(z,n))-TAKE(a,-1,-1),2*PI()))),Nx,,1),
VSTACK(a,HSTACK(Nr,RAD(b,CHOOSEROWS(z,Nr)))))))),
CHOOSEROWS(z,TAKE(pl,,1)))
ConvexHull.xlsb
Jun 01 2023 07:28 AM
Jun 01 2023 07:34 AM - edited Jun 01 2023 07:35 AM
I'm a hardcore ALT + ENTER + Space Bar kind of guy, so formatting formulas to be vertically is imperative for me. And in reviewing the formula, I have to ask, what´s this %% (double percentages)? And also, what's this secret function =RAD() ?
note: I'm not a LAMBDA expert like the brilliant minds that have posted here. Yet, I'm always eager to learn the -- core concepts -- of interesting and complex formulas.
Jun 01 2023 08:46 AM
Jun 01 2023 05:38 PM
Bo, right now I'm like a little kid with a new toy. Thank you for this! You leave me with good homework to study this mind-blowing formula. I'm attaching this updated version with pivot table slicers for switching the set of dots.
Lastly, I have messaged Andy Pope about this post on this forum.