All Questions
Tagged with haskell computational-geometry
13 questions
2
votes
1
answer
99
views
Find intersection of rectangle with itself rotated
Given \$w, h, \alpha\$ for a rectangle centered at origin with width \$w\$, height \$h\$ and itself rotated by \$\alpha\$ around origin clockwise, I wrote a code to find the intersection area.
...
2
votes
1
answer
349
views
Graham Scan Algorithm in Haskell
I have just begun learning functional programming and Haskell.
This is my attempt to implement a solution to Graham Scan Algorithm in Haskell. Note that I am not even sure if this is indeed Graham ...
4
votes
2
answers
118
views
Determine whether path A→B→C on a plane constitutes a left or right turn
I have recently started learning functional programming and Haskell. I have encountered this problem:
Consider three two-dimensional points a, b, and c. If we look at the angle formed by the line ...
12
votes
2
answers
742
views
Compute the perimeter of a polygon
This is taken from HackerRank, which I hope is okay.
I've been playing around with Haskell and I haven't really been able to find anything that really goes beyond toy examples in terms of how to ...
5
votes
1
answer
2k
views
Calculating a circle with bezier curves
I am new to Haskell, and have been reading Learn You a Haskell for Great Good!.
I've rewritten a problem that I recently solved in JavaScript in Haskell to practice what I have been reading.
A ...
7
votes
1
answer
460
views
Graham scan implementation in Haskell
It looks like this is a really classical question, but I'd like to ask it one more time as all those solutions look quite long and complicated for me (maybe because I am dumb :) )
So this is a ...
4
votes
2
answers
298
views
Implementation of Graham Scan algorithm in Haskell
Here is an implementation of Graham Scan algorithm for computing the convex hull of a finite set of points:
...
4
votes
1
answer
406
views
Ray→plane and ray→quad intersection
This checks the intersection between a Ray and a Plane and between a Ray and a ...
6
votes
1
answer
148
views
'Tis the season for gift-wrapping
When reviewing a Graham scan convex hull algorithm implementation, I wrote the following function in an answer:
...
7
votes
1
answer
521
views
2D Convex hull exercise
I'm reading Real World Haskell, and this is my first try with the language.
This is the result of the exercises of chapter 3:
Consider three two-dimensional points a, b, and c. If we look at the ...
8
votes
2
answers
2k
views
Graham Scan convex hull algorithm
I'm beginning to learn Haskell. I've implemented the Graham Scan algorithm for detection of convex hull following the Real World Haskell book.
I'm looking for general advice regarding the style and ...
10
votes
2
answers
396
views
Artifact collision in plane module
Here's something I tried putting together as I'm learning. Critiques on anything are welcome. There's also a logic bug in the Plane module I can't identify.
The long and the short are that it takes ...
41
votes
1
answer
2k
views
Finding minimum scalar product using ST Monad
Inspired by a Stack Overflow question, I decided to practice my Haskell by taking a crack at the Google Code Jam's Minimum Scalar Product problem:
Given two vectors \$\mathbf{v_1}=(x_1,x_2,\ldots,...