# Bug in ArcLength?

fixed in 10.1 (windows)

With Mathematica 10.0.2:

ArcLength[Line[{{0, 0}, {1, 0}, {2, 0}}]]
ArcLength[Line[{{0}, {1}, {2}}]]
(* 2 *)
(* 2 *)


However,

ArcLength[Line[{{0, 0}, {1, 0}, {2.0, 0}}]]
ArcLength[Line[{{0}, {1}, {2.0}}]]
(* 1. *)
(* 1. *)

• Certainly looks like a bug, especially since ArcLength[{{0.0},{1},{2}}] = 2. Dec 16, 2014 at 2:36
• And ArcLength[Line[{{0, 0}, {1, 0}, {2.000001, 0}}]] is back to 2. again... Dec 16, 2014 at 3:05
• Confirmed on 10.0.1 on Windows 7(64). This is quite horrible. Dec 16, 2014 at 7:06
• The bug is actually in RegionMeasure. Try RegionMeasure[Line[{{0, 0}, {1, 0}, {2., 0}}], 1] and RegionMeasure[Line[{{0, 0}, {1, 0}, {2, 0}}], 1] Dec 16, 2014 at 10:00
• Has this been reported to support@wolfram.com? Dec 16, 2014 at 11:35

Yes, this is a bug in the more general function RegionMeasure. I knew there were some edge cases in the handling of inexact numerics, but I was unaware of such a simple example. I will forward this bug internally.

Workarounds include using the parametric (2-argument) form of ArcLength, and using DiscretizeRegion to pre-process regions before sending them to ArcLength/RegionMeausure:

In[21]:= ArcLength[DiscretizeRegion@Line[{{0, 0}, {1, 0}, {2.0, 0}}]]

Out[21]= 2.

In[22]:= ArcLength[DiscretizeRegion@Line[{{0}, {1}, {2.0}}]]

Out[22]= 2.

• This seems to be an issue with any Line composed of collinear segments and having inexact numbers for coordinates. Feb 7, 2015 at 18:07

bug fixed in 10.1 (windows)

code

ArcLength[Line[{{0, 0}, {1, 0}, {2, 0}}]]
ArcLength[Line[{{0}, {1}, {2}}]]
ArcLength[Line[{{0, 0}, {1, 0}, {2.0, 0}}]]
ArcLength[Line[{{0}, {1}, {2.0}}]]