Questions tagged [rotation]

A rotation is a circular movement of an object around a center (or point) of rotation. On a mobile device, it indicates the change of orientation.

A three-dimensional object rotates always around an imaginary line called a rotation axis. If the axis is within the body, and passes through its center of mass the body is said to rotate upon itself, or spin. A rotation about an external point, e.g. the Earth about the Sun, is called a revolution or orbital revolution, typically when it is produced by gravity.

Mathematically, a rotation is a rigid body movement which, unlike a translation, keeps a point fixed. This definition applies to rotations within both two and three dimensions (in a plane and in space, respectively.)

A rotation is commonly represented using , a rotation or .

On a mobile device, it indicates the change of orientation.

12013 questions
44
votes
7 answers

Fast tensor rotation with NumPy

At the heart of an application (written in Python and using NumPy) I need to rotate a 4th order tensor. Actually, I need to rotate a lot of tensors many times and this is my bottleneck. My naive implementation (below) involving eight nested loops…
Andrew Walker
  • 2,451
  • 2
  • 18
  • 15
44
votes
6 answers

How to increase the rotation speed in android?

I have an image drawable. i rotating the image like a progress bar.
Praveen
  • 90,477
  • 74
  • 177
  • 219
44
votes
4 answers

How to spin an android icon on its center point?

I have written the following to spin my icon on the center of the screen and instead it rotates around the upper-left corner (i.e., origin x=0, y=0 of the ImageView). It should be simple to set some attributes of the ImageView or the…
mobibob
  • 8,670
  • 20
  • 82
  • 131
44
votes
10 answers

What's the correct way to rotate a UILabel 90 degrees?

I'm attempting to rotate a UILabel 90 degrees within a UIView. The following snippet is an attempt to write something in Swift that can do that: // #define DEGREES_TO_RADIANS(x) (x * M_PI/180.0) let angle:CGFloat = (90.0 * 3.14/180.0) as…
Frederick C. Lee
  • 9,019
  • 17
  • 64
  • 105
43
votes
3 answers

How to rotate Text in WPF by keeping the Auto-Sizing function

I want to have an text vertical. I just use a simple grid in WPF to auto-size the areas. But when using RotateTransform, all calculations are wrong. Any idea how to solve this?
Nasenbaer
  • 4,810
  • 11
  • 53
  • 86
41
votes
9 answers

Algorithm to rotate an image 90 degrees in place? (No extra memory)

In an embedded C app, I have a large image that I'd like to rotate by 90 degrees. Currently I use the well-known simple algorithm to do this. However, this algorithm requires me to make another copy of the image. I'd like to avoid allocating…
user9876
  • 10,954
  • 6
  • 44
  • 66
39
votes
4 answers

How can I rotate a matplotlib plot through 90 degrees?

I have created a figure in matplotlib which contains three subplots, one in the top left quadrant, one in the top right quadrant, and one in the bottom right quadrant. The top right figure contains a two-d image, and the other two plots are the…
user3443148
  • 411
  • 1
  • 4
  • 5
38
votes
13 answers

Responsive website on iPhone - unwanted white space on rotate from landscape to portrait

I am creating a responsive website, and have just noticed a strange behaviour in my content pages when viewed on the iPhone. It scales correctly when loaded in portrait mode, and also when rotated to landscape. However, when rotating back to…
ellawson
  • 1,033
  • 1
  • 8
  • 13
38
votes
2 answers

How can I rotate a font icon 45 degrees?

I want to rotate this font icon 45 degrees. The icon has this CSS (all CSS compiled via LESS): [class^="flaticon-"]:before, [class*=" flaticon-"]:before, [class^="flaticon-"]:after, [class*=" flaticon-"]:after { font-family: Flaticon; font-size:…
YPCrumble
  • 26,610
  • 23
  • 107
  • 172
37
votes
9 answers

Android: Rotate whole layout

I need to be able to rotate whole layouts on the fly (on the click of a button). I am able to rotate the layouts using, eg. layout.setRotation(270.0f). The problem is, after the rotation, the layout height and width are not matching its parent's. I…
boulaycote
  • 602
  • 1
  • 6
  • 18
37
votes
1 answer

How to rotate a Three.js Vector3 around an axis?

How to rotate a Three.js Vector3 by a certain angle around an axis?
MaiaVictor
  • 51,090
  • 44
  • 144
  • 286
36
votes
2 answers

How to rotate sub-views around their own centres?

Is it possible to rotate a view around its own centre? In my present implementation the sub-views (buttons, etc) seem to move along a funny path before they end up in the desired positions (since the super view's coordinate system is rotated). I…
ragnarius
  • 5,642
  • 10
  • 47
  • 68
36
votes
3 answers

Rotating an ImageView like a compass (with the "north pole" set elsewhere)

I'm stumped regarding how to implement a "personal compass", ie a compass that points to a specific bearing instead of the standard "north pole"... unfortunatly, my current attempt has come out wrong (doesn't point at the given bearing). It's also…
karllindmark
  • 6,031
  • 1
  • 26
  • 41
36
votes
9 answers

iOS 6 rotations: supportedInterfaceOrientations doesn´t work?

I´m having this issue with iOS 6 SDK: I´m having some views that should be allowed to rotate (e.g. a videoview), and some that don´t. Now I understand I have to check all orientations in the app´s Info.plist and then sort out in each ViewController,…
stk
  • 6,311
  • 11
  • 42
  • 58
35
votes
0 answers

Rotate Text as Headers in a table (cross browser)

This is not a question. I just felt that after spending this much time figuring out how to do this I would hate myself if i didn't save it somewhere and I would be a lousy programmer if I didn't share what I had found. (Killing two birds with one…
APalmer
  • 919
  • 3
  • 11
  • 22