sortNumbers( randRangeUnique( -5, 5, 4 ) ) [ BLUE, GREEN, PINK, ORANGE ] randRangeUnique( 0, 3, 2 ) [ "A", "B", "C", "D" ][ IDX_1 ] [ "A", "B", "C", "D" ][ IDX_2 ] POINT_1 + POINT_2 abs( POINTS[ IDX_1 ] - POINTS[ IDX_2 ] )

¿Cuánto mide SEGMENT?

init({range:[[-6,6],[-1,1]]}),style({stroke:"#999"}),line([-5,0],[5,0]);for(var x=-5;5>=x;x++)line([x,-.2],[x,.2]),label([x,-.53],String(x).replace(/-(\d)/g,"\\llap{-}$1"),"center",{color:"#999"});style({strokeWidth:3.5}),line([0,-.2],[0,.2]),style({stroke:COLORS[0],fill:COLORS[0]}),circle([POINTS[0],0],.1),style({stroke:COLORS[1],fill:COLORS[1]}),circle([POINTS[1],0],.1),style({stroke:COLORS[2],fill:COLORS[2]}),circle([POINTS[2],0],.1),style({stroke:COLORS[3],fill:COLORS[3]}),circle([POINTS[3],0],.1),label([POINTS[0],0],"A","above",{color:COLORS[0]}),label([POINTS[1],0],"B","above",{color:COLORS[1]}),label([POINTS[2],0],"C","above",{color:COLORS[2]}),label([POINTS[3],0],"D","above",{color:COLORS[3]})
SOLUTION

SEGMENT significa la distancia de \color{COLORS[ IDX_1 ]}{POINT_1} a \color{COLORS[ IDX_2 ]}{POINT_2}.

SEGMENT = |\color{COLORS[ IDX_1 ]}{POINTS[ IDX_1 ]} - \color{COLORS[ IDX_2 ]}{POINTS[ IDX_2 ]}|

SEGMENT = |POINTS[ IDX_1 ] - POINTS[ IDX_2 ]|

SEGMENT = SOLUTION