Geogebra中对图片和文本进行旋转


旋转图片和文本,而且在坐标平面上,看上去没有那么容易,因为图片/文本只能取边缘平行于坐标轴的矩形,从而,实际的大小就总是在旋转中变化,所以,旋转看上去是不稳定的.

这个永动机表达的动图半途而废就是因为木有掌握好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]
       ]
    ]
]


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值