Skip to content

Update Julia Jarvis March to use points from Graham Scan #709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

berquist
Copy link
Member

This uses the points from

Point(-5,2), Point(5,7), Point(-6,-12), Point(-14,-14), Point(9,9),

It revealed a bug in this implementation that needs to be fixed.

@berquist berquist added Problem This is a problem in the archive or an implementation. Implementation Edit This provides an edit to an algorithm implementation. (Code and maybe md files are edited.) labels May 24, 2020
@leios
Copy link
Member

leios commented May 24, 2020

Could you elaborate on the bug a bit?

@berquist
Copy link
Member Author

Sure. The output from the Python code is

(-14, -14)
(15, -9)
(9, 9)
(0, 14)
(-6, 15)
(-10, 11)

but, from the same initial points, the Julia output is

Pos[Pos(-14.0, -14.0), Pos(15.0, -9.0), Pos(-6.0, 15.0), Pos(-14.0, -14.0)]

I haven't bothered to debug this. If someone sees the obvious fix, feel free to modify this PR or issue a new one.

@leios
Copy link
Member

leios commented Jun 23, 2020

So I was looking at this today. There is definitely a bug in some implementations, but it is unclear what that is because the python code is radically different. We can rewrite the julia code to match the python code, but right now we probably need a better way of defining all the points to find the convex hull.

I really need to revise these chapters anyway, so I'll bump that up on the list.

I feel like we had this discussion somewhere on github before, but I can't find it. Sorry!

@berquist
Copy link
Member Author

berquist commented Jul 4, 2020

The discussion was in #708 (comment). What solution do you think is better, that one, or this hard-coded set? The points inside or on a circle from a square grid makes more sense to me.

@leios
Copy link
Member

leios commented Jul 4, 2020

I agree. The only caveat is that we need to somehow ensure all output is the same. A hard-coded set is easier to do that with.

@berquist
Copy link
Member Author

berquist commented Jul 5, 2020

Yes, also my thoughts. Well, we are already going on a system of trust with PR review. One thing that might help is sorting the output. Ideally the output is also not big, which is easily checked.

@ntindle
Copy link
Member

ntindle commented Aug 28, 2021

[lang: julia]

@github-actions github-actions bot added the lang: julia Julia programming language label Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Implementation Edit This provides an edit to an algorithm implementation. (Code and maybe md files are edited.) lang: julia Julia programming language Problem This is a problem in the archive or an implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants