<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Weird issue with DistanceBetweenPoints]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1170&amp;type=atom" />
	<updated>2019-05-20T00:45:38Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=1170</id>
		<entry>
			<title type="html"><![CDATA[Re: Weird issue with DistanceBetweenPoints]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4984#p4984" />
			<content type="html"><![CDATA[<p>Many thanks!<br />It work!<br />The best support ever!</p>]]></content>
			<author>
				<name><![CDATA[danielesuppo]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=956</uri>
			</author>
			<updated>2019-05-20T00:45:38Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4984#p4984</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Weird issue with DistanceBetweenPoints]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4982#p4982" />
			<content type="html"><![CDATA[<p>Open the DistanceBetweenPoints method you are using.<br />At the end of the method there will be a check for NaN for Y.<br />Add the same check for X.<br />Example for a method using Vector2:<br /></p><div class="codebox"><pre><code>public static Vector2 DistanceBetweenPoints(Vector2 point1, Vector2 point2)
{
    // ...
    if (float.IsNaN(sizeX)) sizeX = 0; // &lt;--- ADD THIS
    if (float.IsNaN(sizeY)) sizeY = 0;
    return new Vector2(sizeX, sizeY);
}</code></pre></div><p>The same logic for the other methods. <br />Just copy-paste the check line for Y and replace Y to X.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-05-19T22:41:32Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4982#p4982</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Weird issue with DistanceBetweenPoints]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4981#p4981" />
			<content type="html"><![CDATA[<p>Yes, but unfortunatley I rely on DistanceBetweenPoints for some maths.<br />Anyway I&#039;ll wait, maybe if you have a minor update just for this bug it would be really appreciated <img src="https://forum.infinity-code.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[danielesuppo]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=956</uri>
			</author>
			<updated>2019-05-19T22:30:58Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4981#p4981</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Weird issue with DistanceBetweenPoints]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4980#p4980" />
			<content type="html"><![CDATA[<p>1-2 weeks.</p><p>This bug does not require the immediate release of a fix, because you can easily check for NaN on your side.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-05-19T21:32:55Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4980#p4980</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Weird issue with DistanceBetweenPoints]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4979#p4979" />
			<content type="html"><![CDATA[<p>Great!<br />Do you know when you will release the new version with this bug corrected?</p>]]></content>
			<author>
				<name><![CDATA[danielesuppo]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=956</uri>
			</author>
			<updated>2019-05-19T21:27:00Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4979#p4979</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Weird issue with DistanceBetweenPoints]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4965#p4965" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Thank you for the bug report.<br />The problem has been fixed.<br />In the next version this will work correctly.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-05-16T17:50:58Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4965#p4965</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Weird issue with DistanceBetweenPoints]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4962#p4962" />
			<content type="html"><![CDATA[<p>Hello, I&#039;m using&nbsp; <br />OnlineMapsUtils.DistanceBetweenPoints(Vector2 &nbsp; &nbsp; point1,&nbsp; Vector2 point2)</p><p>to calculate the distance between some Vector2 longitude/latitude points.</p><p>It work fine for most of my values, but unexpectedly it fail on a couple of points, because it return a Nan value.<br />I&#039;ve tried using doubles instead of Vector2 and it return a totally weird value.</p><p>I really don&#039;t know why, please can you check the picture in attachment and help me to understand what&#039;s going on?<br />Many thanks!</p>]]></content>
			<author>
				<name><![CDATA[danielesuppo]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=956</uri>
			</author>
			<updated>2019-05-16T16:01:12Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4962#p4962</id>
		</entry>
</feed>
