The defendant Lawrence J. Cavanaugh was convicted, after a jury trial, of possession of heroin with intent to distribute and possession of heroin with intent to distribute within 1,000 feet of a school zone. On appeal, he argues that his motion for a required finding of not guilty at the close of the Commonwealth’s case should have been allowed because *112the evidence was insufficient to establish his guilt. In addition he contends that the Commonwealth’s sole witness, a police officer, invaded the fact-finding function of the jury by testifying as both a percipient witness and an expert. We affirm the convictions.
Background. Upon review, we consider the evidence up to the time the Commonwealth rested its case and the defendant moved for a required finding of not guilty. Commonwealth v. Cardenuto, 406 Mass. 450, 454 (1990). Viewing the evidence in the light most favorable to the Commonwealth, considering all the circumstances and making appropriate inferences, we determine whether “any rational trier of fact could have found the essential elements of the crime beyond a reasonable doubt.” Commonwealth v. Cordle, 412 Mass. 172, 175 (1992).
At the close of the Commonwealth’s case the jury could have found the following facts. On September 30, 2000, at approximately 10:30 p.m., Boston police Sergeant Stephen Meade was on duty in the Fields Comer area of the Dorchester section of Boston in an unmarked police car. As a result of a radio call, he began surveillance of a woman, later identified as Catherine Ledbetter, standing at 500 Geneva Avenue, a large commercial property comprised of several retail businesses and a large parking lot. Within minutes, a male, later identified as Giovanni Guide, approached Ledbetter. After a brief conversation, Guide and Ledbetter walked into the parking lot and entered a parked vehicle operated by the defendant. Ledbetter got into the front passenger seat and Guide climbed into the back seat behind her. The defendant turned to Guide and handed him an item. Guide appeared to look at the item for a few seconds, and handed an item back to the defendant. Guide then got out of the car and walked away from the area. The defendant, with Ledbetter still in the front passenger seat, drove out of the parking lot through an exit onto Geneva Avenue. Meade followed the defendant and called for a marked police unit to stop the defendant’s vehicle.
The defendant drove up Geneva Avenue, past Charles Street, onto Topliff Street. Meade observed the defendant reach back and place an item in the back seat area of the vehicle. The defendant drove the length of Topliff Street, a distance of about five or six blocks, until it intersected with Bowdoin Street. *113When the vehicle arrived at Bowdoin Street, it was stopped by officers in a marked Boston police cruiser. Sergeant Meade approached the passenger side of the defendant’s vehicle. On the floor of the vehicle directly behind the front passenger seat Meade observed what appeared to be a small bundled packet. He took possession of the packet, which contained fifty individually wrapped bags of heroin banded together in five packages of ten individual bags. The defendant and Ledbetter were arrested and transported to the police station for booking.
At trial, Sergeant Meade testified about the details of the transaction between the defendant and Guide. He further testified that the transaction occurred within 1,000 feet of the Grover Cleveland School, a city of Boston elementary school located on Charles Street directly behind the buildings at 500 Geneva Avenue. Charles Street merges onto Geneva Avenue approximately 600 feet from the school property. Meade testified that he used a measuring wheel to determine the distance between the school property and the location of the drug transaction. Because the buildings stood in the way, Meade could not use the wheel to measure the straight-line distance between the school and the site of the transaction. Instead, he used the wheel to measure two distances — the distance from the school to the comer of Charles Street and Geneva Avenue (600 feet), and the distance from the comer of Charles Street and Geneva Avenue to the point of the transaction (in excess of 600 feet). Using a mathematical theorem (the Pythagorean theorem1), he determined that the straight-line distance between the location of the transaction and the Grover Cleveland School property was 971 feet. The trial judge allowed the jury to hear the testimony, but later excluded all testimony regarding the Pythagorean theorem on the basis that the Commonwealth failed to lay a proper foundation for its use. Specifically, the judge found no evidence that Charles Street and Geneva Avenue formed a right angle. Instead, the judge permitted the Com*114monwealth to argue that the evidence demonstrated that the defendant had possessed the drugs within 1,000 feet of the school property because the defendant’s vehicle came within 600 feet of the school as it passed the intersection of Charles Street and Geneva Avenue. He also instructed the jury, however, that they could consider Sergeant Meade’s testimony regarding his actual measurements using the measuring wheel.
Discussion. 1. Motion for required finding. General Laws c. 94C, § 32J, commonly known as the “school zone” statute, establishes a mandatory minimum term of imprisonment of not less than two years for any person who violates G. L. c. 94C, §§ 32-32F, or § 321, while within 1,000 feet of a public or private elementary, vocational, or secondary school. The statute also provides that lack of knowledge of school boundaries is not a defense in such a case and that the two-year mandatory minimum sentence be served from and after any sentence imposed for the violation of G. L. c. 94C, §§ 32-32F, or § 321.
The Supreme Judicial Court has adopted a broad reading of the provisions of the school zone statute. “After the elements of [the predicate] offense have been established, one need only take out the tape measure to see if [§ 32J] has been violated.” Commonwealth v. Roucoulet, 413 Mass. 647, 650-651 (1992), quoting from State v. Ivory, 124 N.J. 582, 593 (1991). Section 32J, like its Federal counterpart codified at 21 U.S.C. § 860 (1994), was enacted in order to “establish a 1,000 feet drug-free school zone .... [in order to make] every school and surrounding community safe from the destructive impact of drug trafficking and drug abuse.” Roucoulet, supra at 651 n.7. Section 32J is a strict liability crime that does not require the Commonwealth to prove that the defendant intended to distribute the drugs within the school zone, only that he possessed them within the school zone with an intent to distribute them somewhere. Id. at 650.
The defendant is not helped by his reference to Commonwealth v. Alvarez, 413 Mass. 224, 230 n.5 (1992), in which the court noted:
“There may be extraordinary circumstances shown in some cases which would make it unfair to find guilt under *115§ 32J. See, e.g., United States v. Coates, 739 F. Supp. 146, 152-153 (S.D.N.Y. 1990) (dismissing school zone indictment where defendant was alleged to be in possession of drugs on an underground train near a school; ‘[t]o posit liability ... in these fortuitous circumstances is simple overreaching’).”
In Coates, the defendants were charged with possession with intent to distribute 4,018 grams of cocaine within 1,000 feet of a technical school in an office complex adjoining the train station. United States v. Coates, 739 F. Supp. 146, 148 (S.D. N.Y. 1990). The defendants moved to dismiss the school zone charges as inapplicable to the established facts. Id. at 152. In sustaining the defendant’s motion, the United States District Court judge held that there was no evidence that the defendants, ensconced in a railway car, were in Penn Station to distribute cocaine within 1,000 feet of a school zone, or for that matter to distribute cocaine within New York State at all. Id. at 153.
Here, the defendant argues that to hold a defendant not apprehended within the school zone, and whose passage in an automobile through the school zone was fortuitous, would stretch the statute beyond logical and acceptable bounds. We voice no opinion on that set of circumstances, because those are not the facts with which we are presented. In this case, the facts established that the defendant intentionally conducted an illegal drug transaction, then left that area, passing well within the proscribed 1,000 feet of the school. In view of these facts, together with the supporting testimony of Meade concerning his measurements, there was no error in the trial judge’s denial of the defendant’s motion for a required finding of not guilty.
2. Evidentiary issue. The defendant also argues that Sergeant Meade improperly invaded the jury’s function as fact finders, in effect giving the jury his personal assurance that the defendant committed an illegal transaction. In response to the prosecutor’s question, Sergeant Meade testified that he wanted a marked cruiser to stop the defendant’s vehicle because his vehicle did not have emergency equipment and “[bjecause I believed that they had just gotten drugs from the male in the back seat and I wanted to recover those drugs.” There was no objection to the *116testimony at the time so we review this claim under the substantial risk of a miscarriage of justice standard. Commonwealth v. Grandison, 433 Mass. 135, 142 (2001).
Testimony consisting of a firsthand police account to the effect that a defendant was engaged in dmg dealing constitutes an opinion of guilt. See Commonwealth v. Woods, 36 Mass. App. Ct. 950, 952 (1994), S.C., 419 Mass. 366 (1995). “Such testimony is unnecessary, and it tends to usurp the jury’s function of drawing inferences from the facts.” Ibid. Here the Commonwealth’s case, consisting of a firsthand account by a police officer, his observations, the discovery of drugs in the defendant’s vehicle, and his opinion as to the significance of the amount of drugs, provided strong proof that the amount of drugs was not consistent with personal use. We conclude that, assuming there was error in admitting the challenged testimony, the error did not create a substantial risk of a miscarriage of justice. See Commonwealth v. Barbosa, 421 Mass. 547, 555 & n.11 (1995).
Judgments affirmed.
The Pythagorean theorem is a theorem in geometry: the square of the length of the hypotenuse of a right triangle equals the sum of the squares of the lengths of the other two sides. Webster’s Third New Intl. Dictionary 1855 (1993).