开发者

How to divide an equilateral triangle into three equal parts using GNUplot

I am using GNUplot to plot my data into barycentric equilateral triangle. The problem is that, I have to draw three lines from the center of the triangle to the three sides of the triangle such that the line should be perpendicular to each side and divide the triangle into three equal parts.

I'm using the following commands in GNUplot to draw a barycentric equilateral triangle.

unset border
unset xtics
unset ytics
set arrow 1 from 0,0 to .5,sqrt(3)/2 nohead front lt -1 lw 1
set arrow 2 from 0,0 to 1,0          nohead front lt -1 lw 1
set arrow 3 from 1,0 to .5,sqrt(3)/2 nohead front lt -1 lw 1
set label 1 "1" at 0.5,sqrt(3)/2+.05
set label 2 "2" at 1+.05,0
set label 3 "3" at -.05,0
set size square
plot 'data.file'

I'm not able to draw thr开发者_JS百科ee perpendicular lines from the center of the triangle to three sides of the triangle. Please help me.

Thanks!

With Regards, Swati


Gnuplot does not provide you with the tools to do ruler and compass constructions, so you have to find the points between which to draw lines manually.

Since the radius of the inscribed circle of an equilateral triangle is sqrt(3)/6 times the length of a side, the center of your triangle is at .5,sqrt(3)/6.

By adding the following lines to your script you can then draw the wanted lines:

set arrow 4 from .5,sqrt(3)/6 to .25,sqrt(3)/4 nohead front lt -1 lw 1
set arrow 5 from .5,sqrt(3)/6 to .75,sqrt(3)/4 nohead front lt -1 lw 1
set arrow 6 from .5,sqrt(3)/6 to .5,0 nohead front lt -1 lw 1
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜