LineScaledCoordinate[{{x1,y1},{x2,y2},…,{xk,yk}},r]
gives the coordinate of a point in the polyline {{x1,y1},{x2,y2},…,{xk,yk}}, at a scaled distance of r from point {x1,y1}.
LineScaledCoordinate[{{x1,y1},{x2,y2},…,{xk,yk}}]
is the same as LineScaledCoordinate[{{x1,y1},{x2,y2},…,{xk,yk}},0.5].
LineScaledCoordinate
LineScaledCoordinate[{{x1,y1},{x2,y2},…,{xk,yk}},r]
gives the coordinate of a point in the polyline {{x1,y1},{x2,y2},…,{xk,yk}}, at a scaled distance of r from point {x1,y1}.
LineScaledCoordinate[{{x1,y1},{x2,y2},…,{xk,yk}}]
is the same as LineScaledCoordinate[{{x1,y1},{x2,y2},…,{xk,yk}},0.5].
Details and Options
- To use LineScaledCoordinate, you first need to load the Graph Utilities Package using Needs["GraphUtilities`"].
- LineScaledCoordinate works for both two and three dimensions.
Examples
open all close allBasic Examples (1)
Needs["GraphUtilities`"]This displays the vertices that form the edges at a point 60% of the way down the arrow:
LayeredGraphPlot[{1 -> 2, 2 -> 3, 1 -> 3, 1 -> 1, 2 -> 1}, EdgeRenderingFunction -> ({Arrow[#1], Text[#2, LineScaledCoordinate[#1, 0.6], Background -> White]}&)]This adds edge labels in GraphPlot3D:
GraphPlot3D[{{1 -> 2, "Edge 12"}, 1 -> 3, 1 -> 4, {1 -> 5, "Edge 15"}, 2 -> 3, 2 -> 4, 2 -> 5, 3 -> 4, 3 -> 5, 4 -> 5}, VertexLabeling -> True, EdgeRenderingFunction -> ({RGBColor[0.5, 0, 0], Line[#1], Black, If[#3 =!= None, Text[#3, LineScaledCoordinate[#1, 0.5], Background -> White], {}]}&)]Interactive Examples (1)
Manipulate[
LayeredGraphPlot[{4 -> 3, 5 -> 3, 5 -> 4, 6 -> 1, 6 -> 2, 6 -> 4, 6 -> 5, 6 -> 3}, VertexLabeling -> True, EdgeRenderingFunction -> ({Line[#1], Text[#2, LineScaledCoordinate[#1, t], Background -> White]}&), ImageSize -> 500], {{t, 0.5}, 0.1, 0.9}, Initialization :> Needs["GraphUtilities`"]]Tech Notes
Related Guides
-
▪
- Graph Utilities Package ▪
- Graphs & Networks ▪
- Graph Visualization ▪
- Computation on Graphs ▪
- Graph Construction & Representation ▪
- Graphs and Matrices ▪
- Graph Properties & Measurements ▪
- Graph Operations and Modifications ▪
- Statistical Analysis ▪
- Social Network Analysis ▪
- Graph Properties ▪
- Mathematical Data Formats ▪
- Discrete Mathematics
Text
Wolfram Research (2007), LineScaledCoordinate, Wolfram Language function, https://reference.wolfram.com/language/GraphUtilities/ref/LineScaledCoordinate.html.
CMS
Wolfram Language. 2007. "LineScaledCoordinate." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/GraphUtilities/ref/LineScaledCoordinate.html.
APA
Wolfram Language. (2007). LineScaledCoordinate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/GraphUtilities/ref/LineScaledCoordinate.html
BibTeX
@misc{reference.wolfram_2026_linescaledcoordinate, author="Wolfram Research", title="{LineScaledCoordinate}", year="2007", howpublished="\url{https://reference.wolfram.com/language/GraphUtilities/ref/LineScaledCoordinate.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_linescaledcoordinate, organization={Wolfram Research}, title={LineScaledCoordinate}, year={2007}, url={https://reference.wolfram.com/language/GraphUtilities/ref/LineScaledCoordinate.html}, note=[Accessed: 13-June-2026]}