Q:

How to calculate collision detection from big rectangle to small rectangle?

I have big rectangle that can move from side to side, its boundaries can't enter the small rectangle inside it, the anchor point is in the middle of both of them.
Let's say the big rect is 1000 * 1000, and the small one is 200 * 200
in the game the small rect is the "camera" and the big rect is the ground, only the ground moves.
The solution can be in any programming language.
Here is some drawing to show what I mean :

A:

It's just some basic maths. There are a lot of sides and tutorials about collision detection. For example this could help:
What is the fastest way to work out 2D bounding box intersection?
It is really easy, as long as no box rotates. Then it is called AABB (Axis Aligned Bounding Box). It gets a little bit more complicated, if they rotate, but it's still not taht difficult. Just ask Google for "Box Collision Detection"

