-1

I want to transform coordinates in order to place them on an arc that emanates from the center of a circle. For example, from the set pts, I want to project those into pts2.

pts = Flatten[Table[{x, y}, {x, 10}, {y, 0, 1}], 1]
pts2 = Join[Table[RotationMatrix[Pi/24].{x, 0}, {x, 10}],Table[{x, 0}, {x, 10}]]

The first set (pts) form a rectangle. The desired transformation maps those coordinates onto an arc. I am seeking something akin to

pts2==Table[TransformationMatrix[???].pts[[i]],{i,Length@pts}]

Effectively, I want to take coordinates from a rectangle and map them onto an arc.

More precicely, I want to change the transformation in the following code (from Dr. belisarius here) so that the word "circle" goes outward from the rightmost position of the circle and rotates counterclockwise as does my handwritten "circle" in the graph:

enter image description here

The code of Dr. belisarius:

Module[{l = 
Cases[First[First[ImportString[ExportString[Style["CIRCLE", Bold, FontFamily -> "Courier", 
     FontSize -> 12], "PDF"], "TextMode" -> "Outlines"]]], 
FilledCurve[a__] :> {EdgeForm[Black], Yellow, FilledCurve[a]}, Infinity]}, 
Animate[Graphics[{Red, Circle[{0, 0}, 1.5], {l /. {x_Real, y_Real} :> 
   y^(1/10) { Sin[t + 1/100 Norm[x, y]], 
              Cos[t + 1/100 Norm[x, y]]}}}], {t, 0, 2 Pi}, 
AnimationRunning -> False, SaveDefinitions -> True]]

In other words, instead of the mapping

{x,y}:> 
y^(1/10) { Sin[t + 1/100 Norm[x, y]], 
          Cos[t + 1/100 Norm[x, y]]}}}], {t, 0, 2 Pi}

what is the mapping that will make the text read outward from the center of the circle?

Using FindGeometricTransform I can get the transformation but not in a general form, so I cannot control the width of the arc and the angle of the text:

FindGeometricTransform[
{{1, 0}, {10, 0}, 
      RotationMatrix[Pi/24].{10, 0}, 
      RotationMatrix[Pi/24].{1, 0}}, 
{{1, 0}, {10, 0}, {10, 1}, {1, 1}}]

only works for specified angles, Pi/24 in the example. I do not get an answer for a symbolic angle, so I cannot manipulate it to put it in the code.

Nicholas G
  • 1,981
  • 10
  • 15
  • 1
    Do you want to project a rectangle in 2D onto some arc? If so, how that arc is defined? Could you clarify, its difficult to understand what you want to achieve? – ercegovac Feb 09 '17 at 12:59
  • The arc is defined by the bottom of the rectangle ({{1,0},{10,0}}) and those same points rotated by Pi/24. Does that make sense? – Nicholas G Feb 09 '17 at 13:21
  • 1
    I have impression that you are not using therms 'transform' and 'project' properly. You cannot 'project' a point onto point, so probably you meant map pts to pts2. And as @bbgodfrey said there are infinite ways to map one set of points onto another. – ercegovac Feb 09 '17 at 13:30

1 Answers1

2

Needless to say that your additional explanation made things even more fuzzy. Nevertheless, this code provided by Mr.Wizard as one of the answers to the question you referenced does what you want. Basically you need to modify part where the coordinates are generated and the rotation function.

txt = "This is some text to warp." // Characters;
arc = 1;
range = Range[0, arc, arc/(Length@txt - 1)];
coords = # {Cos[#], Sin[#]} & /@ range;

Graphics[MapThread[
  Rotate[Text[Style[#, FontFamily -> "Courier"], #2], 
    2 ArcTan[#2[[2]]/(10^-10 + #2[[1]])]] &, {txt, coords, range}], 
 Axes -> True]

enter image description here

Update

txt = " Circle" // Characters;
arc = 1;
range = Range[0, arc, arc/(Length@txt - 1)];
coords = # {Cos[#], Sin[#]} & /@ range;
coords = {#, #} & /@ range;
Graphics[{Circle[{0, 0}, 30], 
  MapThread[
   Rotate[Text[
      Style[#, FontFamily -> "Courier", 
       FontSize -> (10 + 60 Sqrt[#2[[1]]^2 + #2[[2]]^2])], #2*(20 + 
         10 Sqrt[#2[[1]]^2 + #2[[2]]^2])], 
     ArcTan[#2[[2]]/(10^-10 + #2[[1]])]] &, {txt, coords, range}]}, 
 FrameTicks -> None]

enter image description here

ercegovac
  • 1,017
  • 8
  • 17
  • This text reads around the circle. I want it to read outwards. In other words, the bottom of the letters of the text touch a radius of the circle and the tops of the letters touch a different radius of the circle. So that the text reads outward but not in constant size but growing as we go outward. – Nicholas G Feb 09 '17 at 14:04
  • @NicholasG I am getting vague Idea where you are going. But you really need to modify your question because if you see what you have asked, it is nowhere close to what your comment says. If there is more than one (unrelated) problem, separate them in different questions. – ercegovac Feb 09 '17 at 14:13
  • @NicholasG In the code above, after FontFamily->"Courier" if you add the following part FontSize -> (10 + 20 Sqrt[#2[[1]]^2 + #2[[2]]^2]) will scale size of the code linearly with radius. – ercegovac Feb 09 '17 at 14:16
  • The text in the example you offer does not read outwards from the center of the circle, it reads around the circle. The text must touch a single radius of the circle on its bottom and a single radius on its top. – Nicholas G Feb 09 '17 at 14:27
  • If you observe part coords = # {Cos[#], Sin[#]} & /@ range you can see that the radius changes from 0 to some maximum radius (follows spiral) determined by the size of the text. It cannot be seen on the image, but if you turn axes on and add a curve you can see that. – ercegovac Feb 09 '17 at 14:48
  • I think we understand something different by top of text and bottom of text. In the string "VVVV" the top of the text consists of eight points, the tops of each V, and the bottom consists of four points, the nadir of each V. Each of those sets of points should be on a radius of the circle. – Nicholas G Feb 09 '17 at 15:05