473,657 Members | 2,721 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Rotating a cube

Hello. Need some help here. I have a 4*4 cube. So the equation of the
cube becoming:

x + 4*y + 16*z

Now i want to rotate this cube 90 degrees anticlockwise( a right
rotation). How can i do that? The rotation must take place with the
axis of rotation being the straight line through the center of the
cube and perpendicular to the "xz-plane." The axis are aligned in this
fashion:

y
|
|
|________ x
/
/
z

Moreover, also tell me how to perform a rotation with the axis of
rotation being the straight line through the center of the cube and
perpendicular to the "yz-plane."

Essentially, I need the equations of the lines after the rotation has
been done in both cases.
Is there a built in Python function for this?
Jul 17 '08 #1
7 3180
J-Burns wrote:
Is there a built in Python function for this?
for answering questions that have nothing to do with programming, and
looks quite a bit like homework? don't think they've added that one yet.

maybe you should look for a geometry newsgroup/forum?

</F>

Jul 17 '08 #2
On Jul 17, 12:53 pm, Fredrik Lundh <fred...@python ware.comwrote:
J-Burns wrote:
Is there a built in Python function for this?

for answering questions that have nothing to do with programming, and
looks quite a bit like homework? don't think they've added that one yet.

maybe you should look for a geometry newsgroup/forum?

</F>
I meant to ask how would you do this in Python... :S
Jul 17 '08 #3
Have you taken the time to solve the problem for the 2D case?

I can't say my code is correct or even good python, but this was my
attempt at the 2D case, maybe it will give you some ideas.

http://code.google.com/p/rs-wxpython...e/rectangle.py

For the rest of c.l.p, criticism is welcome :-)

Regards,
Ryan

On Jul 17, 2:11 am, J-Burns <arslanbur...@g mail.comwrote:
On Jul 17, 12:53 pm, Fredrik Lundh <fred...@python ware.comwrote:
J-Burns wrote:
Is there a built in Python function for this?
for answering questions that have nothing to do with programming, and
looks quite a bit like homework? don't think they've added that one yet.
maybe you should look for a geometry newsgroup/forum?
</F>

I meant to ask how would you do this in Python... :S
Jul 17 '08 #4
J-Burns wrote:
Hello. Need some help here. I have a 4*4 cube. So the equation of the
cube becoming:

x + 4*y + 16*z

Now i want to rotate this cube 90 degrees anticlockwise( a right
rotation). How can i do that? The rotation must take place with the
axis of rotation being the straight line through the center of the
cube and perpendicular to the "xz-plane." The axis are aligned in this
fashion:

y
|
|
|________ x
/
/
z

Moreover, also tell me how to perform a rotation with the axis of
rotation being the straight line through the center of the cube and
perpendicular to the "yz-plane."

Essentially, I need the equations of the lines after the rotation has
been done in both cases.
Is there a built in Python function for this?
--
http://mail.python.org/mailman/listinfo/python-list
=============== =============== ========

OH-Boy!

1) a regular cube is dimensioned having three mutually perpendicular
axis, each of same length. The 4x4 would be for a plane.
2) Clockwise IS Angles Right. (Rotate to right.)
Normal Angles Right would put zero at +Y, 90 at +X as viewed from +Z.
Norman Angles Right would put zero at +Z, 90 at +Y as viewed from +X.
Normal Angles Right would put zero at +Z, 90 at -X as viewed from +Y.
(there are six faces, finish the defs for the rest.)
3) Normally all rotations are defined as pivoting about the 0,0,0 point.
To use center of a plane or other pivot point is to add offsets.
4) Sequence of rotations controls final spatial orientation.

As for finding a cube handling graphic in the standard package download,
I did not. Somebody else can answer if there is a full blown Python
vector graphic package.

At a minimum you need to define a:
rotational routine that handles N 3D points as a single bundle.
The usual routines consider each rotation as being about a single axis.
It computes all N corners each time.
translation routine that moves N 3D points as a single bundle along a
single 3D vector.
It computes all N corners each time.
scaler routine that expands/contracts the relative distances between
the N 3D points using vectors from the computed 3D center.
It computes all N corners each time.
Some pre-/post routines to put things together to get the desired effects.

If N=0 (the nothing) there is nothing to do.
If N=1 (the point) there is no rotation or scale.
If N>1 (the line,plane,box, sphere,torus,et c.) then use all three.
(a sphere can be computed as three points of an isosceles triangle in
which the third side can equal the other two. The points then are used
to create a circle (ellipse) which is rotated about the third side.
In case it isn't obvious - the perpendicular bisector of the third side
is the center of the sphere. To track a point on a sphere is simply to
use 4 points. 0,1,2 are triangle and 3 is the point. Do your thing on
all 4, use 0,1,2 to remake sphere and 3 will be right place.)

The Chemical Rubber Company's Handbook of Physics and Chemistry is a
good starting point for the equations. Johnny, George, Willie and I
also used a few Celestial Mechanics books from the Library when we wrote
those in assembly in the long ago and far away. (back in the '60s on the
other side of the continent.) Sorry, but the punch cards disappeared
long ago and access to CAD programs deletes my need to re-write them.
Steve
no******@hughes .net
Jul 17 '08 #5
Lie
On Jul 17, 3:11*pm, J-Burns <arslanbur...@g mail.comwrote:
On Jul 17, 12:53 pm, Fredrik Lundh <fred...@python ware.comwrote:
J-Burns wrote:
Is there a built in Python function for this?
for answering questions that have nothing to do with programming, and
looks quite a bit like homework? *don't think they've added that one yet.
maybe you should look for a geometry newsgroup/forum?
</F>

I meant to ask how would you do this in Python... :S
The same as you do it in any other languages. This question is marked
correctly as having no relationship to python whatsoever. You'd get a
better answer if you asked in mathematics/geometry group, many
mathematician are adept programmer as well.
Jul 19 '08 #6
David Lyon wrote:
But is the question about display graphics ?

ie rotating a cube using a python framework ?

With something like python and OpenGL ? or Python and PovRay... or
perphaps python and imagemagick ?
can you name one graphics framework that represents a cube as "x + 4*y +
16*z" ?

</F>

Jul 20 '08 #7
Fredrik Lundh wrote:
David Lyon wrote:
>But is the question about display graphics ?

ie rotating a cube using a python framework ?

With something like python and OpenGL ? or Python and PovRay... or
perphaps python and imagemagick ?

can you name one graphics framework that represents a cube as "x + 4*y
+ 16*z" ?
no, but ...
I don't think the notation is so strange,
in electronics (and others) I'm used to a 2-dimensional complex notation:
vector = 3 + 4*i = 3*x +4*y

but although my English isn;t very well,
a "cube of 4*4" looks strange to me.

cheers,
Stef
>
</F>

--
http://mail.python.org/mailman/listinfo/python-list
Jul 20 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2557
by: mrwoopey | last post by:
Hi, My OLAP data cube is giving me the following error when I am manipulating OLAP data cube views: "the data being processed is over the allowed limit" I know that this message is caused by the size limit of each form field that is retrieved in the Request object is 102,399 bytes. The error occurs when I exceed this limit.
3
27915
by: Biswajit Barik | last post by:
Hi All, I want to create a cube using MSSQL2000 i dont know any thing how to create and what is parameter required so if any body help me i will be thankfull to him/her.For information : i have 4 tables custdetailtable which contain all about a customer as per example customer ID,name,add,CUSTOMERID IS PRIMARYKEY, Proddetail table which contain all about a product mean productcode,productname,productvalue,dman (dateof manufacture),dexp...
0
3111
by: mrwoopey | last post by:
Hi, I am using the OLAP data cube in a web browser (using the code from the SQL 2000 toolkit). The OLAP services is on database server and the web interface is on the web server. If we do simple queries on the cube, it works fine. When we do complex queries the cube in the web browser loads very slow or errors. Also, I noticed that when it is building the output for the cube (the display) that most of the processing is taking place on...
0
1809
by: Fan Ruo Xin | last post by:
I installed Stinger in my PC (w2k). I need to do a quick compare between DB2 OLAP server and DB2 Cube Views. And I only found DB2 Cube Views version8.1 trial code from IBM website. I didn't want to spend a lot of time on this. So I installed the Cube Views 8.1, without uninstall ESE V8.2 code first last Friday. It looks like everything was OK. But I failed to start DB2 Information Center and DB2 CC today. I've seen process - javaw used...
2
1896
by: ravindra4s | last post by:
hi...I am very new to DB2 Cube views, I worked with MS Analyis services earlier and this is new assignment for me to work with DB2 Cube views, Can I get any help regarding this..........Is DB2 Cube views(ROLAP MOLAP or HOLAP storage) and does MDX work with DB2 cube views?
0
977
by: jai83 | last post by:
I have a doubt regarding alphablox-cube views. I have created a cube in the olap centre(using db2 cube view 8.1.10).I imported the cube in alphablox.But while drilling down i am not able to retrieve all the members of that particular level,just one member(alphabetically first in the set) is being displayed.And this is happening with all the dimensions. Could this be a problem in cube creation??if yes what could it be that i am missing? ...
0
1523
by: DC01 | last post by:
I have added a new measure successfully into the normal cube. I then add it to the virtual cube and reprocess all cubes. I can browse the normal cube successfully. Then when I try and browse the virtual cube it says 'Retrieving Data' but then thats it, it just hangs like that. I am using AS2000. The other problem I have is that the data is doubling up when its in the cube. The SQL which sets up the fact tables are all fine and are...
0
1221
by: Tim | last post by:
Hi Folks, I'm not certain if this is the correct group to post this question in, if there is a more appropriate one please advise. We have a cube that takes a little time to build, length of time varies by point in day and source SQL Server loading. While building the cube is 'off-line' and this is bothering the powers that be. As the underlying SQL Server data warehouse grows the time 'off-line' is bound to lengthen.
1
2562
by: AR123 | last post by:
Hi I want to set up a rotating banner. Not sure how to incorporate my rotating banner code into the code below. I want the rotating banner to be the main feature image? This is set up in mediasurface My code is: <!-- start page container --> <div id="pageContainer"> <!-- start middle content area --> <div id="genericMiddle">
0
8382
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8297
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8717
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8498
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7311
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1930
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1600
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.