Cant find mistake in my solution --- Point to Segment Distance Problem 77

Back to General discussions forum

LotvinSergey     2016-09-26 21:30:31
User avatar

Hello! I've tried a number of time to solve Problem 77. Looks like it works with example and also with test data but not stable. I can't fint what's wrong. For example there were wright "6.330192192" and my answer "6.401192194" and 80% of answers is correct. It doesn't depend on where the point is - outside line area or in. If you can see my code saved during my fails, please help with some hint.

Quandray     2016-09-27 06:37:29
User avatar

Hi Sergey,

Sorry, I can't help with Java.
Until a Java expert comes along, all I can offer, is that I solved it using the method described at
https://www.topcoder.com/community/data-science/data-science-tutorials/geometry-concepts-basic-concepts/

LotvinSergey     2016-09-27 14:36:58
User avatar

Hi, I found a mistake in my approach. It is fixed. Thanks for link, I've read it, but decided to make my idea work.

Please login and solve 5 problems to be able to post at forum