旋转图片和文本,而且在坐标平面上,看上去没有那么容易,因为图片/文本只能取边缘平行于坐标轴的矩形,从而,实际的大小就总是在旋转中变化,所以,旋转看上去是不稳定的.
这个永动机表达的动图半途而废就是因为木有掌握好RotateText如何恰当实施.
geogebra.org的网站似乎又能用了(虽然还是很慢,但是总算能用了;自5.0.82版本到当前最新的5.0.109,这中间一段时间我都没能连上)
-----------实际上核心是找到文本的中心; 中心可以从两个对角的corner获取,下面的搜索才发现corner已经是built-in-function,从而问题解决-------------
这个问题的存在和解决,还跟从5.0.82升级到5.0.109之后,关于text /rotatetext 的某个bug被fix掉有重大关系. 建议用最新版:
然后找到一些潜在解决方法:
https://sites.google.com/a/ymsh.tp.edu.tw/geogebra/news/rotatingimagestexts
Command:
- Corner1, Corner2, Corner4
Note: The command name is case-sensitive.
Format:
- Corner1[A, B, width, height, padding]
Parameters:
- A, B: start point, end point
- width: image width (in pixels)
- height: image height (in pixels)
- padding: gap between the image and segment AB (in pixels), can be positive or negative, for example:
+20 indicates that the image is above the segment 20 pixels,
-20 is below the segment 20 pixels.
Example:
- Corner1[A, B, 300,100, -20]
If we have a 300x100 image file, and we want to put it underneath segment AB 20 pixels away, we can set the position property of the image to be:
- Corner 1:Corner1[A, B, 300,100, -20]
- Corner 2:Corner2[A, B, 300,100, -20]
- Corner 4:Corner4[A, B, 300,100, -20]
Once set, the image will maintain its size, no matter where the points A and B are, even if you change the aspect ratio of the entire xy-plane, it still looks like what it should be, no distortion will occur.
Enjoy it if you need
this custom tool.
See this file on
GeoGebraTube.
Corner1[A, B, width, height, padding]=
Midpoint[A,B]
+(padding+sgn(padding)*height/2-height/2)*Vector[
{
{x(Corner[3]-Corner[1])/x(Corner[5]),0},
{0,y(Corner[3]-Corner[1])/y(Corner[5])}
}*
UnitPerpendicularVector[
Vector[
{
{x(Corner[5])/x(Corner[3]-Corner[1]),0},
{0,y(Corner[5])/y(Corner[3]-Corner[1])}
}*Vector[B-A]
]
]
]
+(-width/2)*Vector[
{
{x(Corner[3]-Corner[1])/x(Corner[5]),0},
{0,y(Corner[3]-Corner[1])/y(Corner[5])}
}*
UnitVector[
Vector[
{
{x(Corner[5])/x(Corner[3]-Corner[1]),0},
{0,y(Corner[5])/y(Corner[3]-Corner[1])}
}*Vector[B-A]
]
]
]
Corner2[A, B, width, height, padding]=
Midpoint[A,B]
+(padding+sgn(padding)*height/2-height/2)*Vector[
{
{x(Corner[3]-Corner[1])/x(Corner[5]),0},
{0,y(Corner[3]-Corner[1])/y(Corner[5])}
}*
UnitPerpendicularVector[
Vector[
{
{x(Corner[5])/x(Corner[3]-Corner[1]),0},
{0,y(Corner[5])/y(Corner[3]-Corner[1])}
}*Vector[B-A]
]
]
]
+(width/2)*Vector[
{
{x(Corner[3]-Corner[1])/x(Corner[5]),0},
{0,y(Corner[3]-Corner[1])/y(Corner[5])}
}*
UnitVector[
Vector[
{
{x(Corner[5])/x(Corner[3]-Corner[1]),0},
{0,y(Corner[5])/y(Corner[3]-Corner[1])}
}*Vector[B-A]
]
]
]
Corner4[A, B, width, height, padding]=
Midpoint[A,B]
+(padding+sgn(padding)*height/2+height/2)*Vector[
{
{x(Corner[3]-Corner[1])/x(Corner[5]),0},
{0,y(Corner[3]-Corner[1])/y(Corner[5])}
}*
UnitPerpendicularVector[
Vector[
{
{x(Corner[5])/x(Corner[3]-Corner[1]),0},
{0,y(Corner[5])/y(Corner[3]-Corner[1])}
}*Vector[B-A]
]
]
]
+(-width/2)*Vector[
{
{x(Corner[3]-Corner[1])/x(Corner[5]),0},
{0,y(Corner[3]-Corner[1])/y(Corner[5])}
}*
UnitVector[
Vector[
{
{x(Corner[5])/x(Corner[3]-Corner[1]),0},
{0,y(Corner[5])/y(Corner[3]-Corner[1])}
}*Vector[B-A]
]
]
]