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
35
votes
3 answers

CSS rotation with respect to a reference point

How to rotate an element with respect to a defined point i.e. defined x & y coordinate in CSS (webkit)? Normally rotation make element's center point as reference.
thecodeparadox
  • 86,271
  • 21
  • 138
  • 164
35
votes
10 answers

Rotation Interpolation

NB: I'll present this question in degrees purely for simplicity, radians, degrees, different zero-bearing, the problem is essentially the same. Does anyone have any ideas on the code behind rotational interpolation? Given a linear interpolation…
Rob
  • 1,687
  • 3
  • 22
  • 34
35
votes
3 answers

Rotate image around center css3

I'm trying to spin a world around its center - but cant seem to rotate it the correct way (around its own center axis) Its hard to explain so I made a demo: .world { -webkit-animation: spin1 2s infinite linear; -moz-animation: spin1 2s…
35
votes
4 answers

How to rotate image with CSS only?

I would like to rotate an image by 90 degrees with CSS only. I can do the rotation, but then the position of the image is not what it should be. First, it will overlay some other elements in the same
. Second, its vertical dimension will…
v923z
  • 1,237
  • 5
  • 15
  • 25
35
votes
6 answers

Android Two finger rotation

I am trying to implement two finger rotation in android however, it is not quite working as expected. The goal is to implement rotation like Google Earth does (two-finger rotating the image around the focal point). Currently my rotation listener…
ludo
  • 1,456
  • 2
  • 14
  • 26
34
votes
8 answers

Screen orientation lock

Is there a reliable way to lock screen orientation on all Android devices? The code below works for my Nexus S and other phones, but for some reason ROTATION_90 corresponds to SCREEN_ORIENTATION_REVERSE_PORTRAIT on the Xoom. Is there any way to…
Michael Pardo
  • 2,590
  • 3
  • 24
  • 33
34
votes
10 answers

Normalise orientation between 0 and 360

I'm working on a simple rotate routine which normalizes an objects rotation between 0 and 360 degrees. My C# code seems to be working but I'm not entirely happy with it. Can anyone improve on the code below making it a bit more robust? public void…
JuniorDeveloper
  • 381
  • 1
  • 4
  • 5
33
votes
2 answers

Wonky text anti-aliasing when rotating with webkit-transform in Chrome

I'm rotating an element using -webkit-transform: rotate() and in Chrome 14.0.835.2 dev-m it's doing some really weird stuff to the text inside the element. It reminds me of a similar effect you get in Photoshop when you rotate text using "smooth"…
Rahul
  • 12,181
  • 5
  • 43
  • 64
33
votes
3 answers

iOS 6: Parent modal's modalPresentationStyle ignored after rotation

With iPad with iOS6, we have this bug where a modal view controller will expand to full screen, even if it is told to be using "form sheet" presentation style. But, this happens only if there are two modals, a parent one and its child. So this is…
GenesisST
  • 1,335
  • 13
  • 16
33
votes
1 answer

Cross browser way to rotate image using CSS?

I have a site layout I'm working on that has a main content area and then at each of the four corners of the content area sits a corner graphic. The overall effect is that of a desk blotter. Here is the code for my top left hand…
Cynthia
  • 5,273
  • 13
  • 42
  • 71
33
votes
2 answers

Rotate bitmap by real angle

Once upon a time, reading this question, I wondered how to rotate a bitmap by any degree without fiddling around with all the bits myself. Recently, someone else had obvious difficulties with it too. There are already many questions dealing with…
NGLN
  • 43,011
  • 8
  • 105
  • 200
32
votes
6 answers

Rotating image. Animation list or animated rotate? (Android)

I want to create a rotating progress image, and wonder what's the best way to proceed. I can make it work with an animation list with for example 12 images changing every 100ms. This works fine, but it's quite tedious to create 12 images or for…
Gunnar Lium
  • 6,023
  • 9
  • 35
  • 33
32
votes
5 answers

How to get all 24 rotations of a 3-dimensional array?

I have a 3-dimensional array. Think of it as a brick. There are 24 possible rotations of this brick (that keep its edges parallel to coordinate axes). How do I generate all corresponding 3-dimensional arrays?
31
votes
1 answer

Camera2 understanding the sensor and device orientations

I bumped into an issue while trying to implement a touch to focus feature using the Android Camera2. The theory is easy: obtain the tap position in the preview surface map it to the dimensions of the sensor or sensor crop area (in case of a zoom)…
Dude
  • 1,202
  • 21
  • 30
31
votes
1 answer

How do you know where to perform rotations in an AVL tree?

So I'm self teaching AVL trees and I understand the basic idea behind it, but I just want to make sure my intuition of actually implementing it is valid: I'll examine it with the left rotation- So, the following situation is simple: 8 /…
Skorpius
  • 2,135
  • 2
  • 26
  • 31